summaryrefslogtreecommitdiff
path: root/gtk2_ardour/utils.cc
diff options
context:
space:
mode:
authorDoug McLain <doug@nostar.net>2007-12-05 08:26:41 +0000
committerDoug McLain <doug@nostar.net>2007-12-05 08:26:41 +0000
commit7c0ff18a62046bc81d1666f56e20129f27fb3719 (patch)
tree8d1ecee23c52fc813f5da8e9fcdf5d695a5dbbeb /gtk2_ardour/utils.cc
parentab809bf30c6bc8e1784389f7ade6cb55af109cdd (diff)
add exception handling to Gdk::Pixbuf::create_from_file ()
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2748 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r--gtk2_ardour/utils.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index 686c8e521c..8a9325a940 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -583,7 +583,20 @@ get_icon (const char* cname)
/*NOTREACHED*/
}
- return Gdk::Pixbuf::create_from_file (path);
+ Glib::RefPtr<Gdk::Pixbuf> img;
+ try {
+ img = Gdk::Pixbuf::create_from_file (path);
+ }
+ catch (const Gdk::PixbufError &e)
+ {
+ cerr << "Caught PixbufError: " << e.what() << endl;
+ }
+ catch (...)
+ {
+ g_message("Caught ... ");
+ }
+
+ return img;
}
string