BonoboUnknown & G_SIGNAL_TYPE_STATIC_SCOPE



Hi!

If I create a BonoboItemContainer instance I get the following
g_signal_new error:

  eog-image-viewer (pid:2477): GLib-GObject-CRITICAL **: file gsignal.c:
  line 1192 (g_signal_newv): assertion `(return_type &
  G_SIGNAL_TYPE_STATIC_SCOPE) == 0' failed

The problem seems to be the definition of BONOBO_TYPE_UNKOWN in
libbonobo/bonobo/bonobo-types.h which is the return value for the signal
callback. It sets the G_SIGNAL_TYPE_STATIC_SCOPE flag:

  #define BONOBO_TYPE_UNKNOWN
  (bonobo_unknown_get_type () | G_SIGNAL_TYPE_STATIC_SCOPE)

I absolutely don't know what this flag does and why it's needed but the
following naive patch fixes the problem (btw: should the struct offset
really be zero?):

Index: bonobo/bonobo-item-container.c
===================================================================
RCS file: /cvs/gnome/libbonobo/bonobo/bonobo-item-container.c,v
retrieving revision 1.61
diff -u -p -r1.61 bonobo-item-container.c
--- bonobo/bonobo-item-container.c	2001/11/21 02:16:33	1.61
+++ bonobo/bonobo-item-container.c	2001/12/28 17:22:42
@@ -148,10 +148,10 @@ bonobo_item_container_class_init (Bonobo
 		g_signal_new  ("get_object",
 			       G_TYPE_FROM_CLASS (object_class),
 			       G_SIGNAL_RUN_LAST,
			       0,
 			       NULL, NULL,
 			       bonobo_marshal_BOXED__STRING_BOOLEAN_BOXED,
-			       BONOBO_TYPE_UNKNOWN,
+			       bonobo_unknown_get_type (),
 			       3,
 			       BONOBO_TYPE_STRING,
 			       G_TYPE_BOOLEAN,

Does anybody know what the Right Way (TM) fix is?

Regards,

   Jens

-- 
"Wer die Freiheit aufgibt, um Sicherheit zu gewinnen, wird am Ende beides
verlieren." -- Benjamin Franklin





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