BUG: gtk+ 2.8.17 GDK_IS_PIXBUF macro.



It looks to me like there is a bug in the GDK_IS_xxxxx(object) macros, and probably in the GDK_xxxxx(object) macros.

These macros always invoke a GDK_TYPE_xxxxx macro as their last step which calls a routine gdk_xxxxx_get_type();

Example from gdk-pixbuf/gdk-pixbuf-core.h (reformatted)

#define GDK_TYPE_PIXBUF         (gdk_pixbuf_get_type ())
#define GDK_PIXBUF(object)    \
 (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF, GdkPixbuf))
#define GDK_IS_PIXBUF(object)  \
 (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF))


If the type already exists, as in the case where the dynamically loaded images libpixbufloader-nnnn are used, then the GDK_IS_xxxxx macro will fail with the following visible diagnostics:

(process:1336004): GLib-GObject-WARNING **: cannot register existing type `GdkPixbuf'

(process:1336004): GdkPixbuf-CRITICAL **: file SRC_ROOT:[gtk^+-2^.8^.17.gdk-pixbuf]gdk-pixdata.c;1: line 323: assertion `GDK_IS_PIXBUF (pixbuf)' failed

It looks like these macros should only be invoking the GDK_TYPE_xxxxx macros if the first call to G_TYPE_CHECK_INSTANCE_nnnn() fails.

Either that, or the gdk_xxxxx_get_type() routines need to be able to handle that a type may already have been registered, since there seems to be two different ways of registering the PIXBUF and related types.

This is affecting the generation of two files in the build:

  gtk/stock-icons/gtkstockpixbufs.h
  demos/test-inline-pixbufs.h

The failure to generate the first file is not stopping the build because
it is also supplied in the tarball for gtk+ 2.8.7. The second one failing is preventing the demos directory from being built, and some of the test or demo programs are failing with the same diagnostic above.

I am looking for some recommendations on what to do to get this to work correctly. The obvious thing that looks like it would make the affected programs work would be to remove the GDK_TYPE_PIXBUF invocation from the GDK_IS_PIXBUF macro, or to only invoke it if the G_TYPE_INSTANCE_TYPE(object) call fails.

It looks like the intent of these macros was to register the type if it was not already registered, and only fail if the type was not registered and could not be registered.

-John
wb8tyw qsl net
Personal Opinion Only



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