[gnome-software] trivial: Fix oddness if the refine flags for gnome-software-cmd were invalid



commit 9cdea4240110ca6f667ede8facf0d5f58b0a0523
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jun 30 09:37:58 2017 +0100

    trivial: Fix oddness if the refine flags for gnome-software-cmd were invalid

 lib/gs-cmd.c           |    4 +++-
 lib/gs-plugin-loader.c |    4 ++++
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/lib/gs-cmd.c b/lib/gs-cmd.c
index 42da45b..0f726fe 100644
--- a/lib/gs-cmd.c
+++ b/lib/gs-cmd.c
@@ -297,7 +297,8 @@ gs_cmd_refresh_flag_from_string (const gchar *flag)
 static void
 gs_cmd_self_free (GsCmdSelf *self)
 {
-       g_object_unref (self->plugin_loader);
+       if (self->plugin_loader != NULL)
+               g_object_unref (self->plugin_loader);
        g_free (self);
 }
 
@@ -486,6 +487,7 @@ main (int argc, char **argv)
                        g_autoptr(GsPluginJob) plugin_job = NULL;
                        plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
                                                         "app", app,
+                                                        "refine-flags", self->refine_flags,
                                                         NULL);
                        ret = gs_plugin_loader_job_action (self->plugin_loader, plugin_job,
                                                            NULL, &error);
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 2ff5a00..4df0c96 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -3093,6 +3093,8 @@ gs_plugin_loader_process_thread_cb (GTask *task,
                        return;
                }
                break;
+       case GS_PLUGIN_ACTION_REFINE:
+               break;
        default:
                if (!helper->anything_ran) {
                        g_debug ("no plugin could handle %s",
@@ -3152,6 +3154,8 @@ gs_plugin_loader_process_thread_cb (GTask *task,
                        g_task_return_error (task, error);
                        return;
                }
+       } else {
+               g_debug ("no refine flags set for transaction");
        }
 
        /* convert any unavailable codecs */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]