Re: [gtkmm] ImageLoader



On Don, 2002-12-26 at 18:30, Mortella wrote:
> It segfaults at 
> 	const Glib::RefPtr<Gdk::Pixmap> pixmap = 
> > 		Gdk::Pixmap::create_from_xpm(drawable, mask, transparent, fname);
> drawable's value is 0, my class is derived from Gtk::Container, instance is add-ed to 
> the main window before I call this code... 

This is now fixed in CVS:

2002-12-26  Daniel Elstner  <daniel elstner gmx net>

	* gdk/src/pixmap.ccg (Gdk::Pixmap::create_*): Use Glib::unwrap()
	instead of gobj() since the RefPtr<> can be 0.

	* gdk/src/pixmap.hg (Gdk::Pixmap::create): This has no equivalent
	in GDK and thus doesn't work at all.  A Gdk::Pixmap created via
	this function causes a segmentation fault on the last unreference,
	as the GDK code tries to access data that has never been set up.
	Add TODO comment stating that it should be removed at some point.

	* gdk/src/{bitmap,pixmap}.hg: The ctors and create() methods should
	all take a Gdk::Drawable instead of a Gdk::Window -- add TODOs.
	This has recently been fixed in GDK but we can't follow the change
	without breaking ABI.

However, it looks like passing in 0 for the drawable isn't multihead
safe.  gdkpixmap-x11.c (gdk_pixmap_new) contains the following code:

  if (!drawable)
    {
      GDK_NOTE (MULTIHEAD, g_message ("need to specify the screen parent window "
				      "for gdk_pixmap_new() to be multihead safe"));
      drawable = gdk_screen_get_root_window (gdk_screen_get_default ());
    }

--Daniel





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