Inheriting GtkPlug



What's the Right way to inherit GtkPlug when providing a constructor?

I'm getting an assertion failure when I create my derived object with
g_object_new:

        (process:29266): GLib-GObject-WARNING **: invalid (NULL) pointer instance
        
        GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
        
The stack trace leading up to this looks like this:

        #0  0x000000341d832215 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
        #1  0x000000341d833d83 in abort () at abort.c:88
        #2  0x0000000000f4521b in IA__g_logv (log_domain=0xaefedc "GLib-GObject", log_level=G_LOG_LEVEL_CRITICAL, format=0xf975e7 "%s: assertion `%s' failed", args1=0x7fff19380960) at gmessages.c:497
        #3  0x0000000000f452b3 in IA__g_log (log_domain=0x356b <Address 0x356b out of bounds>, log_level=13675, format=0x6 <Address 0x6 out of bounds>) at gmessages.c:517
        #4  0x0000000000add124 in IA__g_signal_connect_data (instance=0x0, detailed_signal=0x342600696d "composited_changed", c_handler=0x3425f0970c <gtk_window_on_composited_changed>, data=0x258d0b0, destroy_data=0, connect_flags=0) at gsignal.c:1637
        #5  0x0000003425efed59 in gtk_window_init (window=Could not find the frame base for "gtk_window_init".
        ) at gtkwindow.c:903
        #6  0x0000000000aea0a1 in IA__g_type_create_instance (type=<value optimized out>) at gtype.c:1567
        #7  0x0000000000acfa2b in g_object_constructor (type=13675, n_construct_properties=13675, construct_params=0x6) at gobject.c:1046
        #8  0x0000000000418b23 in vrml_control_constructor (type=39300624, n_construct_properties=3, construct_properties=0x258ab90) at .././../src/openvrml-xembed/control.cpp:43
        #9  0x0000000000ad0063 in IA__g_object_newv (object_type=39300624, n_parameters=<value optimized out>, parameters=0x258abb0) at gobject.c:937
        #10 0x0000000000ad0bb7 in IA__g_object_new_valist (object_type=39300624, first_property_name=0x0, var_args=0x7fff19380fa0) at gobject.c:986
        #11 0x0000000000ad0cfc in IA__g_object_new (object_type=39300624, first_property_name=0x0) at gobject.c:795
        
My constructor looks like this:

        GObject *
        vrml_control_constructor(GType type,
                                 guint n_construct_properties,
                                 GObjectConstructParam * construct_properties)
        {
            GObject * obj;
            {
                // Invoke parent constructor.
                VrmlControlClass * klass =
                    VRML_CONTROL_CLASS(
                        g_type_class_peek(VRML_CONTROL_TYPE));
                GObjectClass * parent_class =
                    G_OBJECT_CLASS(g_type_class_peek_parent(klass));
                obj = parent_class->constructor(type,
                                                n_construct_properties,
                                                construct_properties);
                gtk_plug_construct(GTK_PLUG(obj), 0);
            }
        
            return obj;
        }

-- 
Braden McDaniel                           e-mail: <braden endoframe com>
<http://endoframe.com>                    Jabber: <braden jabber org>




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