[gnome-software: 6/9] application: Always clear search provider




commit 5a9c5cdbec5a6a37c9cc798185c202f233220f4f
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Aug 18 15:38:30 2022 -0300

    application: Always clear search provider
    
    GsShellSearchProvider is cleared when unregistering the application
    from D-Bus, but sometimes that is never called, such as when quitting
    GNOME Software from another terminal with 'gnome-software --quit'
    
    Continue unregistering the search provider there, but move cleaning
    up the search provider object to dispose.

 src/gs-application.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 83aea790a..6e919d341 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -175,10 +175,8 @@ gs_application_dbus_unregister (GApplication    *application,
 {
        GsApplication *app = GS_APPLICATION (application);
 
-       if (app->search_provider != NULL) {
+       if (app->search_provider != NULL)
                gs_shell_search_provider_unregister (app->search_provider);
-               g_clear_object (&app->search_provider);
-       }
 }
 
 static void
@@ -1171,6 +1169,7 @@ gs_application_dispose (GObject *object)
        g_cancellable_cancel (app->cancellable);
        g_clear_object (&app->cancellable);
 
+       g_clear_object (&app->search_provider);
        g_clear_object (&app->plugin_loader);
        g_clear_object (&app->shell);
        g_clear_object (&app->update_monitor);


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