I've a memory leak (JsVars) in my bluetooth implementation.
For easy testing I built a simple testfunction.
After each call of this function, process.memory.free is reduced by 2
Whats wrong in my code.
/*JSON{
"type" : "staticmethode",
"class" : "ESP32",
"name" : "test",
"generate" : "jswrap_ESP32_test",
"params":[ ["text","JsVar","test text"] ]
}
for testing only
*/
JsVar *tmp;
void jswrap_ESP32_test(JsVar *text){
char txt[20];
jsvGetString(text,txt,sizeof(txt)); // this is a short replacment of the data I get in Bluetooth
tmp = jsvNewStringOfLength(sizeof(txt), txt);
return;
}
Tried to add jsvUnLock and/or jsvUnRef on tmp, and sooner or later got HALT
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I've a memory leak (JsVars) in my bluetooth implementation.
For easy testing I built a simple testfunction.
After each call of this function, process.memory.free is reduced by 2
Whats wrong in my code.
Tried to add jsvUnLock and/or jsvUnRef on tmp, and sooner or later got HALT