MXS-1929: Store filters in smart pointers

The FilterDef structs are now stored in a vector<std::shared_ptr>. This
should make it easier to use filters even if they are deleted before the
session using them closes.

All internal functions now take a smart point as a parameter. One
problematic case will be debugcmd.cc which moves information around as
pointers cast into unsigned longs.
This commit is contained in:
Markus Mäkelä
2018-08-01 19:06:54 +03:00
parent d793fcbcb0
commit 00ab890b19
3 changed files with 129 additions and 134 deletions

View File

@ -215,7 +215,7 @@ bool runtime_create_filter(const char *name, const char *module, MXS_CONFIG_PARA
*
* @return True if filter was destroyed
*/
bool runtime_destroy_filter(FilterDef* filter);
bool runtime_destroy_filter(const SFilterDef& filter);
/**
* @brief Destroy a monitor
@ -283,9 +283,9 @@ MXS_MONITOR* runtime_create_monitor_from_json(json_t* json);
*
* @param json JSON defining the filter
*
* @return Created filter or NULL on error
* @return True if filter was created, false on error
*/
FilterDef* runtime_create_filter_from_json(json_t* json);
bool runtime_create_filter_from_json(json_t* json);
/**
* @brief Create a new service from JSON