fix random crashes upon !reload
A struct plugin_hub_internals was falsely casted to struct plugin_callback_data. This caused the contained commands list pointer to point to a struct hub_info and commands->size took the value of a pointer to a struct net_connection. Since size is increased/decreased every time an item is added to/removed from the list, this resulted in some funny crashes. This fix is a little dirty as it exports some internals.
This commit is contained in:
@@ -23,14 +23,7 @@
|
||||
|
||||
struct plugin_callback_data;
|
||||
|
||||
struct plugin_hub_internals
|
||||
{
|
||||
struct hub_info* hub;
|
||||
plugin_unregister_f unregister; /* The unregister function. */
|
||||
struct plugin_callback_data* callback_data; /* callback data that is unique for the plugin */
|
||||
};
|
||||
|
||||
static struct plugin_hub_internals* get_internals(struct plugin_handle* handle)
|
||||
struct plugin_hub_internals* get_internals(struct plugin_handle* handle)
|
||||
{
|
||||
struct plugin_hub_internals* internals;
|
||||
assert(handle && handle->handle && handle->handle->internals);
|
||||
|
||||
Reference in New Issue
Block a user