[evince/wip/chpe/export-print-portal-custom-options: 1/8] shell: Fix critical on startup




commit c62d4ef5164e2dc4f5cbef6b6d30314bd7ab48ac
Author: Christian Persch <chpe src gnome org>
Date:   Sat Nov 13 17:20:09 2021 +0100

    shell: Fix critical on startup
    
    Only destroy the popup if it exists. Fixes a critial warning on startup:
    Gtk-CRITICAL **: 22:18:32.672: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
    
    Fixes regression added in commit 2bfe441dc59c41fd7230a8903127cf5056526e0c.

 shell/ev-zoom-action.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/shell/ev-zoom-action.c b/shell/ev-zoom-action.c
index df7210b3c..dd47eb002 100644
--- a/shell/ev-zoom-action.c
+++ b/shell/ev-zoom-action.c
@@ -192,7 +192,8 @@ max_zoom_changed_cb (EvDocumentModel *model,
        EvZoomActionPrivate *priv = GET_PRIVATE (zoom_action);
 
         g_menu_remove_all (G_MENU (priv->zoom_free_section));
-        gtk_widget_destroy (GTK_WIDGET (priv->popup));
+        if (priv->popup)
+                gtk_widget_destroy (GTK_WIDGET (priv->popup));
         priv->popup = NULL;
         ev_zoom_action_populate_free_zoom_section (zoom_action);
 }


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