[gnome-software] GCancellable is optional...
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] GCancellable is optional...
- Date: Thu, 22 Aug 2013 17:20:14 +0000 (UTC)
commit 6b7e2e59afa8d5f85569dba4ffd123c584c0b281
Author: Richard Hughes <richard hughsie com>
Date: Thu Aug 22 18:14:08 2013 +0100
GCancellable is optional...
src/gs-plugin-loader.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 9faae16..603bd6c 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -960,7 +960,8 @@ gs_plugin_loader_thread_func (gpointer user_data)
g_object_unref (helper->plugin_loader);
g_object_unref (helper->app);
- g_object_unref (helper->cancellable);
+ if (helper->cancellable != NULL)
+ g_object_unref (helper->cancellable);
g_free (helper);
return NULL;
}
@@ -977,7 +978,8 @@ gs_plugin_loader_app_install (GsPluginLoader *plugin_loader,
helper = g_new0 (GsPluginLoaderThreadHelper, 1);
helper->plugin_loader = g_object_ref (plugin_loader);
helper->app = g_object_ref (app);
- helper->cancellable = g_object_ref (cancellable);
+ if (cancellable != NULL)
+ helper->cancellable = g_object_ref (cancellable);
helper->function_name = "gs_plugin_app_install";
helper->state_progress = GS_APP_STATE_INSTALLING;
helper->state_success = GS_APP_STATE_INSTALLED;
@@ -999,7 +1001,8 @@ gs_plugin_loader_app_remove (GsPluginLoader *plugin_loader,
helper = g_new0 (GsPluginLoaderThreadHelper, 1);
helper->plugin_loader = g_object_ref (plugin_loader);
helper->app = g_object_ref (app);
- helper->cancellable = g_object_ref (cancellable);
+ if (cancellable != NULL)
+ helper->cancellable = g_object_ref (cancellable);
helper->function_name = "gs_plugin_app_remove";
helper->state_progress = GS_APP_STATE_REMOVING;
helper->state_success = GS_APP_STATE_AVAILABLE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]