Add recycling of destroyed monitors

If a destroyed monitor is created again, it will be reused. This should
prevent excessive memory growth when the same monitor is created and
destroyed again.
This commit is contained in:
Markus Mäkelä
2017-08-03 09:13:20 +03:00
parent a3e9d5c327
commit 512c3c018d
6 changed files with 131 additions and 64 deletions

View File

@ -3112,13 +3112,6 @@ int create_new_monitor(CONFIG_CONTEXT *context, CONFIG_CONTEXT *obj, HASHTABLE*
MXS_ERROR("Failed to create monitor '%s'.", obj->object);
error_count++;
}
if (obj->was_persisted)
{
/** Not the cleanest way of figuring out whether the configuration
* was stored but it should be OK for now */
((MXS_MONITOR*)obj->element)->created_online = true;
}
}
else
{