Solved some leaks (properly) from loader.
@@ -1248,10 +1248,10 @@ void loader_impl_destroy_dtor(plugin p)
void loader_impl_destroy(plugin p, loader_impl impl)
{
if (impl != NULL)
- {
- if (impl->init == 0)
{
if (p != NULL)
+ {
+ if (impl->init == 0)
{
loader_impl_interface iface = loader_iface(p);
@@ -1261,10 +1261,14 @@ void loader_impl_destroy(plugin p, loader_impl impl)
{
log_write("metacall", LOG_LEVEL_ERROR, "Invalid loader implementation (%s) interface destruction <%p>", plugin_name(p), iface->destroy);
}
- }
impl->init = 1;
}
+ }
+ else
+ {
+ loader_impl_destroy_objects(impl);
+ }
loader_impl_destroy_deallocate(impl);
}
