[gnome-software/gnome-40: 1/2] GsAppRow: Emit "unrevealed" signal only if mapped




commit 627e049638db6609aad3d8a284016ce2b849688c
Author: Milan Crha <mcrha redhat com>
Date:   Tue Apr 6 19:28:48 2021 +0200

    GsAppRow: Emit "unrevealed" signal only if mapped
    
    There can happen, with proper timing, that a GsAppRow is being revealed
    from the Installed or Updates page when the page reloads and removes
    all rows from itself. The "unrevealed" signal handler also removes
    the row from the list and it is emitted when the list unmaps the row,
    as a consequence of the end of the reveal animation, it can cause a crash
    due to NULL parent property dereference on the gtk+ side.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1195

 src/gs-app-row.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index 00f2f99ee..039efc541 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -497,7 +497,7 @@ child_unrevealed (GObject *revealer, GParamSpec *pspec, gpointer user_data)
         * catch the case where we are being removed from a container without
         * having been destroyed first.)
         */
-       if (priv->app == NULL)
+       if (priv->app == NULL || !gtk_widget_get_mapped (GTK_WIDGET (app_row)))
                return;
 
        g_signal_emit (app_row, signals[SIGNAL_UNREVEALED], 0);


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