<blockquote>
<p>Also a little question regarding the plugin API: as the utils lib is not a registered plugin - how can I get a callback on closing of geany to free the memory allocated for the utils lib?</p>
</blockquote>
<p>If this library was statically compiled into each plugin (don't think it is), you could probably use <code>g_module_unload</code>.</p>
<p>If you wanted to cover 99% of the cases (GCC or Clang) automatically, you could use the destructor attribute, like maybe:</p>
<div class="highlight highlight-source-c"><pre>#<span class="pl-k">ifdef</span> __GNUC__
#<span class="pl-k">define</span> <span class="pl-en">GP_UTILS_DESTRUCTOR</span> <span class="pl-en">__attribute__</span>((destructor))
#<span class="pl-k">else</span> 
#<span class="pl-k">define</span> <span class="pl-en">GP_UTILS_DESTRUCTOR</span>
#edif

GP_UTILS_DESTRUCTOR
<span class="pl-k">void</span> <span class="pl-en">gp_utils_finalize</span>(<span class="pl-k">void</span>)
{
    <span class="pl-c"><span class="pl-c">//</span> ...</span>
}</pre></div>
<p>Alternatively, you could add two functions like <code>gp_utils_init</code> and <code>gp_utils_finalize</code> that could be called from each plugin which uses the library, to initialize and cleanup internal memory of the library.</p>
<blockquote>
<p>Also I do not want to create the hashtable I use per caller but share it among the plugins.</p>
</blockquote>
<p>Then it would probably have to go inside Geany I suspect, or Geany would have to link to and init/cleanup the utils library, which is sort of counter to its design.</p>
<p>Since stock items still exist in the current major version of GTK+, it seems like a lot of work/waste to avoid some deprecation warnings, IMO. Maybe you could make some wrapper header/macro that disables the deprecating warnings in specific bulk-deprecated headers like gtkstock.h or whichever, and include it first before other headers? The deprecation warnings are annoying, but they just mean "Will be removed for GTK+ 4", pretty much.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany-plugins/pull/865?email_source=notifications&email_token=AAIOWJ3Q37LIVL7JEYETBBLPWA6FJA5CNFSM4HN2FXNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVWS5FI#issuecomment-493694613">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJYZP4B5AXHHISGGWOTPWA6FJANCNFSM4HN2FXNA">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAIOWJYM7UDWNIRKKK6KRPDPWA6FJA5CNFSM4HN2FXNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVWS5FI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany-plugins/pull/865?email_source=notifications\u0026email_token=AAIOWJ3Q37LIVL7JEYETBBLPWA6FJA5CNFSM4HN2FXNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVWS5FI#issuecomment-493694613",
"url": "https://github.com/geany/geany-plugins/pull/865?email_source=notifications\u0026email_token=AAIOWJ3Q37LIVL7JEYETBBLPWA6FJA5CNFSM4HN2FXNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVWS5FI#issuecomment-493694613",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>