What is an "invalid unclassed object pointer"?



I'm trying to wrap the gtkhtml2 widget into PyGtk.  One of the signals an
HtmlDocument instance can emit takes an HtmlStream*.  This struct was not
declared to be a subclass of GObject, so I "upgraded" it in hopes of making
it available to Python.  (On the pygtk list it was also suggested that
HtmlStream could be registered as a boxed type, but that seems to require
some involvement with a central registry.)  The simple test that comes with
gtkhtml2 works, but when a request-url signal is emitted in my Python script
(when an embedded image must be fetched), I get this warning:

    gsignal.c:1878:g_signal_emit_valist(): invalid unclassed object pointer
    for value type `HtmlStream'

I thought I had everything set in HtmlStream and HtmlDocument, but I guess I
missed something.  In htmldocument.c, the REQUEST_URL signal is set up with

    document_signals [REQUEST_URL] =
            g_signal_new ("request_url",
                          G_TYPE_FROM_CLASS (object_class),
                          G_SIGNAL_RUN_LAST,
                          G_STRUCT_OFFSET (HtmlDocumentClass, request_url),
                          NULL, NULL,
                          html_marshal_VOID__STRING_OBJECT,
                          G_TYPE_NONE,
                          2,
                          G_TYPE_STRING,
                          HTML_TYPE_STREAM);

HTML_TYPE_STREAM has the obvious definition.  The signal is emitted as

    g_signal_emit (G_OBJECT (doc), document_signals [REQUEST_URL], 0, uri,
                   stream);

where stream is an HtmlStream*.  When I set a breakpoint in g_log and move
up the stack to the g_signal_emit call, the stream argument looks like so:

    $1 = {
      parent_instance = {
        g_type_instance = {
          g_class = 0x0
        }, 
        ref_count = 0, 
        qdata = 0x0
      }, 
      user_data = 0x8200e60, 
      cancel_data = 0x0, 
      written = 0, 
      write_func = 0x409f0ef0 <write_pixbuf>, 
      close_func = 0x409f0f60 <close_pixbuf>, 
      cancel_func = 0
    }

This suggests to me that something's not getting initialized.  The
html_stream_init function is empty.  (I just copied it from
html_document_init and changed the name.)  It seems odd to me that the init
function should be completely empty.  Shouldn't it at least chain up to the
parent's init function?

Any suggestions appreciated,

-- 
Skip Montanaro (skip pobox com - http://www.mojam.com/)



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