[gnome-system-monitor] Avoid crash if icon is not found by catching exception.



commit 0d394b2d9df72d9ad67deafebf9174b38b42a6d9
Author: Robert Roth <robert roth off gmail com>
Date:   Wed Jan 4 00:16:09 2012 +0200

    Avoid crash if icon is not found by catching exception.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=662463

 src/iconthemewrapper.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/iconthemewrapper.cpp b/src/iconthemewrapper.cpp
index fb062da..f2bf89b 100644
--- a/src/iconthemewrapper.cpp
+++ b/src/iconthemewrapper.cpp
@@ -1,6 +1,7 @@
 #include <config.h>
 
 #include <gtkmm/icontheme.h>
+#include <giomm/error.h>
 
 #include "iconthemewrapper.h"
 
@@ -19,5 +20,10 @@ procman::IconThemeWrapper::load_icon(const Glib::ustring& icon_name,
             g_error("Cannot load icon '%s' from theme: %s", icon_name.c_str(), error.what().c_str());
         return Glib::RefPtr<Gdk::Pixbuf>();
     }
+    catch (Gio::Error &error)
+    {
+        g_debug("Could not load icon '%s' : %s", icon_name.c_str(), error.what().c_str());
+        return Glib::RefPtr<Gdk::Pixbuf>();
+    }
 }
 



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