# Unsolicitated invocation of g\_object\_run\_dispose() on GTypeModule when running unit tests

**URL:** https://discourse.imfreedom.org/t/unsolicitated-invocation-of-g-object-run-dispose-on-gtypemodule-when-running-unit-tests/129
**Category:** GPlugin
**Tags:** development
**Created:** [February 21, 2024, 12:05pm UTC](https://discourse.imfreedom.org/t/unsolicitated-invocation-of-g-object-run-dispose-on-gtypemodule-when-running-unit-tests/129 "2024-02-21T12:05:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ivanhoe](https://discourse.imfreedom.org/user_avatar/discourse.imfreedom.org/ivanhoe/32/24_2.png) [@ivanhoe](https://discourse.imfreedom.org/u/ivanhoe)
#### Post date: [February 21, 2024, 12:05pm UTC](https://discourse.imfreedom.org/t/unsolicitated-invocation-of-g-object-run-dispose-on-gtypemodule-when-running-unit-tests/129/1 "2024-02-21T12:05:40Z")

</div>

I’m getting a `GLib-GObject-FATAL-CRITICAL` with the message `unsolicitated invocation of g_object_run_dispose() on GTypeModule` when I run **some** of the libpurple tests. It looks like the affected tests are those which include `test_ui.h`. I didn’t test all of them but `test_contact_info` and `test_protocol_contacts` definitely show this behaviour.

The critical is happening when the plugins are removed in the cleanup phase. This is a backtrace from valgrind:

```auto
Process terminating with default action of signal 5 (SIGTRAP)          
   at 0x4C7AC79: g_logv (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.4)      
   by 0x4C7AF02: g_log (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.4)               
   by 0x4BF3C78: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7800.4)          
   by 0x4BD29BF: g_object_unref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7800.4)
   by 0x4F479A3: gplugin_manager_remove_list_value (gplugin-manager.c:119)
   by 0x4C5D710: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.4)
   by 0x4F47F9F: gplugin_manager_finalize (gplugin-manager.c:294)
   by 0x4BD2A8B: g_object_unref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7800.4)
   by 0x4F4850D: gplugin_manager_private_uninit (gplugin-manager.c:548)
   by 0x4F45F9E: gplugin_uninit (gplugin-core.c:93)
   by 0x48B887B: purple_plugins_uninit (plugins.c:522)
   by 0x48A3674: purple_core_quit (core.c:266)

```

Anybody else getting this critical message?

I wonder if this is related to the same message that comes up during build from `ircv3generategir`. But the critical when running tests is not limited to the IRCv3 plugin. I manually excluded the plugins, which otherwise would cause the critical message, from being unref’d and it happens with all GObject based plugins it seems.

---

<div class="post-metadata">

### Author: ![grim](https://discourse.imfreedom.org/user_avatar/discourse.imfreedom.org/grim/32/4_2.png) [@grim](https://discourse.imfreedom.org/u/grim)
#### Post date: [February 21, 2024, 12:08pm UTC](https://discourse.imfreedom.org/t/unsolicitated-invocation-of-g-object-run-dispose-on-gtypemodule-when-running-unit-tests/129/2 "2024-02-21T12:08:08Z")

</div>

This is an issue with unloading the plugins by calling `gplugin_manager_unload_plugin` on native plugins which happens at application shutdown too so you’ll see it spammed there as well.

There’s some stuff I’m not clear on when it comes to `GTypeModule` and I haven’t really spent the time looking into it.
