79696633

Date: 2025-07-10 07:17:52
Score: 1.5
Natty:
Report link

Found the solution after so long. I needed the following function call

plugin_module_make_resident

in my module load function:

G_MODULE_EXPORT void geany_load_module(GeanyPlugin* plugin) {
    // Step 1: set meta-data
    // <snip>

    // Step 2: set functions
    plugin->funcs->init = projectview_v2_init;
    plugin->funcs->cleanup = projectview_v2_cleanup;
    plugin->funcs->configure = NULL;
    plugin->funcs->help = NULL;
    
    // Prevent segfault in plugin when it registers GTypes and gets unloaded
    // and when reloaded tries to re-register the GTypes.
    plugin_module_make_resident(plugin); // <-- needed this call

    // Step 3: register
    GEANY_PLUGIN_REGISTER(plugin, 248);
}

https://www.geany.org/manual/reference/pluginutils_8h.html#ac402e1d165036aaeb5ae1e176e536c36

Reasons:
  • Blacklisted phrase (0.5): I need
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: xBACP