[network-manager-applet/th/applet-icon-crash-bgo762421] applet: avoid setting negative icon-size for applet



commit e1075eee971082a371ecc21893e5a365bf34e41d
Author: Thomas Haller <thaller redhat com>
Date:   Mon Feb 29 12:35:46 2016 +0100

    applet: avoid setting negative icon-size for applet
    
    Seems we can hit
      (nm-applet:4985): nm-applet-CRITICAL **: nma_icons_reload: assertion 'applet->isize > 0' failed
    
    which can only happen if the icon-size reported by "size-changed" is
    negative. Avoid that.

 src/applet.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index f2578ce..7ba7744 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -3048,7 +3048,12 @@ status_icon_size_changed_cb (GtkStatusIcon *icon,
        /* icon_size may be 0 if for example the panel hasn't given us any space
         * yet.  We'll get resized later, but for now just load the 16x16 icons.
         */
-       applet->icon_size = size ? size : 16;
+       if (size > 0)
+               applet->icon_size = size;
+       else {
+               applet->icon_size = 16;
+               g_warn_if_fail (size == 0);
+       }
 
        nma_icons_reload (applet, NULL);
 


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