MXS-1992 Provide std::default_delete<json_t>
This commit is contained in:
@ -14,6 +14,7 @@
|
||||
|
||||
#include <maxscale/cppdefs.hh>
|
||||
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
@ -22,6 +23,20 @@
|
||||
#include <maxscale/jansson.h>
|
||||
#include <maxscale/utils.hh>
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
||||
template<>
|
||||
struct default_delete<json_t>
|
||||
{
|
||||
void operator()(json_t* pJson)
|
||||
{
|
||||
json_decref(pJson);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace maxscale
|
||||
{
|
||||
|
||||
@ -117,4 +132,5 @@ static inline std::string json_to_string(json_t* json)
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user