[evince/wip/chpe/fix-critial] shell: Fix critical on startup




commit 6afe1b98e3a9ee28b1cda09d284d67a921e7ed0f
Author: Christian Persch <chpe src gnome org>
Date:   Fri Nov 12 23:59:34 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]