Advanced topics: Thunar Extensions Reference Manual

## Advanced topics

This section provides a short introduction to some of the advanced topics in the Thunar Extension Framework.

### Memory-Resident Extensions

Some extensions may not play well with Thunar's on-demand loading and unloading of extensions. For example, an extension that uses a desktop library, which in turn registers additional static GTypes will not work after being loaded and unloaded for the first time. For these kind of extensions, Thunar provides the option to make extensions memory resident, which means the extension will be loaded once and afterwards will never be unloaded again until Thunar exits.

Such extensions must set the `resident` property of the provider plugin in its `thunar_extension_initialize()` function to `TRUE`, using the `thunarx_provider_plugin_set_resident()` method.

Example 2. Making an extension memory resident

    1
    2
    3
    4
    5
    6
    7
    8
    9
    G_MODULE_EXPORT void
    thunar_extension_initialize (ThunarxProviderPlugin *plugin)
    {
      /* setup the types for the extension */
      ...

      /* ensure that the extension will never be unloaded */
      thunarx_provider_plugin_set_resident (plugin, TRUE);
    }