diff options
Diffstat (limited to 'src/instance.c')
-rw-r--r-- | src/instance.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/instance.c b/src/instance.c index 2bce3f6..92c61f9 100644 --- a/src/instance.c +++ b/src/instance.c @@ -232,15 +232,14 @@ void suil_instance_free(SuilInstance* instance) { if (instance) { + if (instance->wrapper) { + instance->wrapper->free(instance->wrapper); + dlclose(instance->wrapper->lib); + } if (instance->handle) { instance->descriptor->cleanup(instance->handle); } dlclose(instance->lib_handle); - if (instance->wrapper) { - void* lib = instance->wrapper->lib; - instance->wrapper->free(instance->wrapper); - dlclose(lib); - } free(instance); } } |