GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Jul 31, 2014 1:32 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: help on gdk_pixbuf_new_from_file crash
PostPosted: Fri Apr 27, 2012 2:22 pm 
Offline
Familiar Face

Joined: Tue Dec 20, 2011 3:27 pm
Posts: 14
Hi all,

i hae the following function, that is called 2 or more times, everytime a new window is created and it needs an icon:

Code:
GdkPixbuf * AppIcon::CreateIcon ()
{
   utils::Sys s;

   GdkPixbuf *pixbuf;
   GError *error = NULL;

   string icon = s.GetProgramPath() + "../res/icon.png";

-->   pixbuf = gdk_pixbuf_new_from_file (icon.c_str(), &error);

   if (!pixbuf)
   {
      fprintf(stderr, "%s\n", error->message);
      g_error_free(error);
   }
   return pixbuf;
}


The second time "gdk_pixbuf_new_from_file" is called i get the following crash (SIGABRT):

Code:
#0 (   0xb7fe2424 in __kernel_vsyscall() (??:??)
#1 0xb716e8f1   *__GI_raise(sig=6) (../nptl/sysdeps/unix/sysv/linux/raise.c:64)
#2 0xb7171d22   *__GI_abort() (abort.c:92)
#3 0xb73fc195   ??() (/lib/i386-linux-gnu/libglib-2.0.so.0:??)
#4 0xb746d6c9   g_private_set() (/lib/i386-linux-gnu/libglib-2.0.so.0:??)
#5 0xb740fdb2   g_get_filename_charsets() (/lib/i386-linux-gnu/libglib-2.0.so.0:??)
#6 0xb74104ce   g_filename_display_name() (/lib/i386-linux-gnu/libglib-2.0.so.0:??)
#7 0xb7749f78   gdk_pixbuf_new_from_file() (/usr/lib/i386-linux-gnu/libgdk_pixbuf-2.0.so.0:??)
#8 0x80a1bdd   AppIcon::CreateIcon(this=0x817df68) (src/ui/window.cc:25)
#9 0x80a1f27   Window::SetTitle(this=0x817df68, title=...) (src/ui/window.cc:171)
#10 0x80a281a   Container::Container(this=0x817df18) (src/mo/container.cc:81)
#11 0x8092304   XmlObjects::ReadContainer(this=0x80cfd60, xml=..., n=0x814a920) (src/xmlobjs.cc:159)
#12 0x8098d96   XmlObjects::ReadSkinXMLFileObjects(this=0x80cfd60, file=...) (src/xmlobjs.cc:579)
#13 0x8091fd4   XmlObjects::ReadSkinXMLObjects(this=0x80cfd60) (src/xmlobjs.cc:128)
#14 0x80919b0   XmlObjects::XmlObjects(this=0x80cfd60) (src/xmlobjs.cc:78)
#15 0x805307f   XmlObjects::get() (include/xmlobjs.hh:67)
#16 0x80a5614   System::getContainer(this=0x811dcd8, vp=...) (src/mo/system.cc:113)
#17 0x8052d71   Base::CallMethod(this=0x811dcd8, method=..., v=...) (include/mo/base.hh:31)
#18 0x8051f83   Interpreter::Call(this=0x80cfaf0, fr=0x811be98) (src/minter.cc:463)
#19 0x8053344   Interpreter::ExecCall(this=0x80cfaf0, fp=0x8143d06) (src/minter.cc:494)
#20 0x805258a   Interpreter::Execute(this=0x80cfaf0, i=258) (src/minter.cc:680)
#21 0x808833a   mldr::Run(this=0x80cfa60, fmaki=...) (src/mloader.cc:2808)
#22 0x804f67d   JPlayer::Run(this=0xbffff5c3) (src/jplayer.cc:164)
#23 0x8050aa5   main(argc=1, argv=0xbffff684) (src/main.cc:30)


I don't see any reason why the second time call have to crash. Every idea about what's causing the issue is really appreciated.

Thanks
angelo


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group