Remove module to be freed from list.

When a module is unregistered, it must be removed from the list.
Otherwise, if explicit unregistering of a module is made, there
will be a crash at shutdown when all modules are unregistered.
This commit is contained in:
Johan Wikman 2016-02-11 15:22:00 +02:00
parent e777828bd0
commit 62aa1ea5d7

View File

@ -351,6 +351,14 @@ unregister_module(const char *module)
{
ptr = ptr->next;
}
/*<
* Remove the module to be be freed from the list.
*/
if (ptr && (ptr->next == mod))
{
ptr->next = ptr->next->next;
}
}
/*<