From 7c0ff18a62046bc81d1666f56e20129f27fb3719 Mon Sep 17 00:00:00 2001 From: Doug McLain Date: Wed, 5 Dec 2007 08:26:41 +0000 Subject: [PATCH] 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 --- gtk2_ardour/utils.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 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 -- 2.30.2