summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-18 21:59:20 +0100
committerinfirit <[email protected]>2014-12-18 21:59:20 +0100
commit89a5256bf2b7292e0fcbd6c7fb0d5a3901271645 (patch)
treec77a11a51ba3a6b4a917a8464371e4b3fc43b31c
parent78ce9269ad83b09fcf1f538a9a1ff7bd6b77b588 (diff)
downloadmate-system-monitor-89a5256bf2b7292e0fcbd6c7fb0d5a3901271645.tar.bz2
mate-system-monitor-89a5256bf2b7292e0fcbd6c7fb0d5a3901271645.tar.xz
Avoid crash if icon is not found by catching exception
Taken from GSM commit: 0d394b2d9df72d9ad67deafebf9174b38b42a6d9 From: Robert Roth <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=662463
-rw-r--r--src/iconthemewrapper.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/iconthemewrapper.cpp b/src/iconthemewrapper.cpp
index 4a66f5c..1e84b31 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>();
+ }
}