-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
inline const char * stringFromValue(const Napi::CallbackInfo& info, int index) {
std::string val = info[index].As<Napi::String>().Utf8Value();
const std::string::size_type size = val.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, val.c_str(), size + 1);
return buffer;
}
Caused by this function, where it clearly allocates memory on char *buffer = new char[size + 1];.
I noticed this when my game's memory was growing and I debugged it down to DrawTextEx call.
Metadata
Metadata
Assignees
Labels
No labels