<blockquote>
<p>I would just deprecate it and recommend g_module_check_init() universally </p>
</blockquote>

<p>But then it's tricky to only make the module resident in <code>init()</code>.  Well, tricky meaning storing the module pointer and using it later, like if it was a <code>geany_load_module()</code> parameter.</p>

<div class="highlight highlight-source-c"><pre><span class="pl-k">static</span> GModule *module_self = <span class="pl-c1">NULL</span>;

G_MODULE_EXPORT
<span class="pl-k">const</span> gchar* <span class="pl-en">g_module_check_init</span>(GModule *module)
{
  module_self = module;
  <span class="pl-k">return</span> <span class="pl-c1">NULL</span>;
}

<span class="pl-k">static</span> gboolean <span class="pl-en">myplugin_init</span>(GeanyPlugin *plugin, gpointer data)
{
  <span class="pl-c1">g_module_make_resident</span>(module_self);

  <span class="pl-k">return</span> <span class="pl-c1">TRUE</span>;
}

G_MODULE_EXPORT
<span class="pl-k">void</span> <span class="pl-en">geany_load_moule</span>(GeanyPlugin *plugin)
{
  <span class="pl-c">/* ... */</span>
  plugin->funcs->init = myplugin_init;
  <span class="pl-c">/* ... */</span>
  <span class="pl-c1">GEANY_PLUGIN_REGISTER</span>(plugin, <span class="pl-c1">234</span>);
}</pre></div>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany/pull/719#issuecomment-156730440">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ32m7zf99UulLExXsAFhGE0mR1Dpks5pF3MHgaJpZM4GZg2a.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/719#issuecomment-156730440"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>