Commit ee114a1b authored by Kalev Lember's avatar Kalev Lember
Browse files

Improve failure code path when install or remove fails

Avoid calling callbacks when install or remove fails, and also make sure
we don't leak InstallRemoveData in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=748694
parent c9ce65e6
......@@ -78,7 +78,7 @@ gs_page_app_installed_cb (GObject *source,
gs_shell_get_window (priv->shell),
GS_PLUGIN_LOADER_ACTION_INSTALL,
error);
return;
goto out;
}
/* only show this if the window is not active */
......@@ -89,6 +89,7 @@ gs_page_app_installed_cb (GObject *source,
if (GS_PAGE_GET_CLASS (page)->app_installed != NULL)
GS_PAGE_GET_CLASS (page)->app_installed (page, data->app);
out:
install_remove_data_free (data);
}
......@@ -113,11 +114,13 @@ gs_page_app_removed_cb (GObject *source,
gs_shell_get_window (priv->shell),
GS_PLUGIN_LOADER_ACTION_REMOVE,
error);
goto out;
}
if (GS_PAGE_GET_CLASS (page)->app_removed != NULL)
GS_PAGE_GET_CLASS (page)->app_removed (page, data->app);
out:
install_remove_data_free (data);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment