diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index c18ee8915..a1b0db323 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -393,6 +393,13 @@ double xyCoordToTemperature(const std::array& white_xy) return res; } +struct cJSON_deleter { + template + void operator()(T *t) { + cJSON_Delete(const_cast::type*>(t)); + } +}; + std::map getAliases(const Glib::ustring& profile_dir) { const std::unique_ptr> file( @@ -419,7 +426,7 @@ std::map getAliases(const Glib::ustring& profile_dir) buffer[read] = 0; cJSON_Minify(buffer.get()); - const std::unique_ptr root(cJSON_Parse(buffer.get())); + const std::unique_ptr root(cJSON_Parse(buffer.get())); if (!root || !root->child) { if (settings->verbose) { std::cout << "Could not parse 'camera_model_aliases.json' file." << std::endl;