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
This commit is contained in:
Doug McLain 2007-12-05 08:26:41 +00:00
parent ab809bf30c
commit 7c0ff18a62

View file

@ -583,7 +583,20 @@ get_icon (const char* cname)
/*NOTREACHED*/ /*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 string