MXS-1992 Provide std::default_delete<json_t>

This commit is contained in:
Johan Wikman
2018-08-02 16:04:52 +03:00
parent 166ecfead6
commit 0d934476b0

View File

@ -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();
}
}