[gnome-software/1337-deadlock-on-switch-to-the-details-page] gs-app: Notify about all property changes in an idle handler



commit afdf8dea01c4140f22e66fc798d0e6100a9bf37e
Author: Milan Crha <mcrha redhat com>
Date:   Mon Aug 2 18:15:39 2021 +0200

    gs-app: Notify about all property changes in an idle handler
    
    It helps to make sure the property change notification handlers
    are always called from the main/GUI thread, thus any listener can
    safely expect the callback can do gtk+ calls and read other app
    properties without causing a deadlock.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1337

 lib/gs-app.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index 2a88922c4..9a5a73ebc 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -1460,7 +1460,7 @@ gs_app_set_name (GsApp *app, GsAppQuality quality, const gchar *name)
                return;
        priv->name_quality = quality;
        if (_g_set_str (&priv->name, name))
-               g_object_notify_by_pspec (G_OBJECT (app), obj_props[PROP_NAME]);
+               gs_app_queue_notify (app, obj_props[PROP_NAME]);
 }
 
 /**
@@ -2396,7 +2396,7 @@ gs_app_set_summary (GsApp *app, GsAppQuality quality, const gchar *summary)
                return;
        priv->summary_quality = quality;
        if (_g_set_str (&priv->summary, summary))
-               g_object_notify_by_pspec (G_OBJECT (app), obj_props[PROP_SUMMARY]);
+               gs_app_queue_notify (app, obj_props[PROP_SUMMARY]);
 }
 
 /**


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