Re: Why would I see g_object_new_with_properties: assertion 'G_TYPE_IS_OBJECT (object_type)' failed?

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

 



In case anyone else finds this in a Google search in the future, this was an interaction between Vala and libpeas. If you annotate a function with [ModuleInit] like we do here: https://github.com/jangernert/FeedReader/blob/master/plugins/backend/feedbin/feedbinInterface.vala#L750, then link it into a library, the Vala compiler magically turns the entire library into a libpeas module. Since I was directly linking the module, the peas_register_types function wasn't being called and the types didn't exist.

I couldn't figure out how to call that function manually, so we just don't link that peas_register_types function in our tests. Long term we'll probably just have a file with nothing but that function so we can test everything else easily.

On Apr 22, 2018, at 12:56 PM, Brendan Long <self@xxxxxxxxxxxxxxx> wrote:

I'm not sure if this is a Glib, Meson or Vala thing, but I don't even understand why this glib error would ever happen so I hope this is the right place to ask (I know it means "this type is null", but I have no idea why that would ever be the case).

I'm trying to convert a Vala project that uses dynamically loaded plugins to Meson:


For some reason, linking a test exectable with one of our plugins causes errors like:

$ ./plugins/backend/feedbin/test_feedbin
/feedbinapi/construct: 
(./plugins/backend/feedbin/test_feedbin:27002): GLib-GObject-CRITICAL **: g_object_new_with_properties: assertion 'G_TYPE_IS_OBJECT (object_type)' failed
Trace/breakpoint trap (core dumped)


We were getting similar issues when linking our main library statically, but it's a shared library now (and the plugin has always been a shared library).

The only things I could find on Google were versioning issues, but I get this error in Docker, where no other version of FeedReader is installed:


Can someone help me understand what's going wrong, and what I might do to fix it? 


_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux