}
static global_ref<v8::Value> js_eina_log_print_cb_data;
-static std::map<int, std::string> js_eina_log_color_map;
+static std::map<int, const char *> js_eina_log_color_map;
static void js_eina_log_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level,
const char *file, const char *fnc, int line,
// We duplicate the color string as eina takes a const char* but does take care of
// its lifetime, assuming a ever lasting string.
- std::string color = *String::Utf8Value(args[1]);
+ const char *color = strdup(*String::Utf8Value(args[1]));
int d = eina_log_domain_register(*String::Utf8Value(args[0]),
- color.c_str());
+ color);
js_eina_log_color_map[d] = color;
auto isolate = args.GetIsolate();
int domain = args[0]->NumberValue();
eina_log_domain_unregister(domain);
+ free((void*)js_eina_log_color_map[domain]);
js_eina_log_color_map.erase(domain);
return compatibility_return();
};