Re: Gdk::Pixbuf::create_from_file("/path/tux.png"); crashes program



On 9/23/07, Martin Metzker <martinmetzker gmx net> wrote:
> Hello World!
>
> The real line is
> Glib::RefPtr< Gdk::Pixbuf > stone_black =
> Gdk::Pixbuf::create_from_file("/usr/share/icons/gentoo/48x48/tux.png");
>
> This line make my application crash. The file exists and permissions are
> correct. If I comment out this line the application works. ... until
> stone_black is accessed but I know where that error comes from :-)

I believe that function actually throws an exception on failure.  So
it's probably not that your application is 'crashing' per se, just
that you have an unhandled exception.  You might try catching the
exception and see what the error is.

-- 
jonner



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