Fixed a memory leak in JS Array.concat(Array), wrapper object was not destroyed.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5798 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
3f359c0a11
commit
fca0d0f1d9
|
@ -652,12 +652,12 @@ bool JsArray::runNative(ObjList& stack, const ExpOperation& oper, GenObject* con
|
|||
int len = ja->length();
|
||||
for (int i = 0; i < len; i++) {
|
||||
NamedString* ns = ja->params().getParam(String(i));
|
||||
op = YOBJECT(ExpOperation,ns);
|
||||
op = op ? op->clone() : new ExpOperation(*ns,0,true);
|
||||
const_cast<String&>(op->name()) = (unsigned int)array->m_length++;
|
||||
array->params().addParam(op);
|
||||
ExpOperation* arg = YOBJECT(ExpOperation,ns);
|
||||
arg = arg ? arg->clone() : new ExpOperation(*ns,0,true);
|
||||
const_cast<String&>(arg->name()) = (unsigned int)array->m_length++;
|
||||
array->params().addParam(arg);
|
||||
}
|
||||
TelEngine::destruct(ja);
|
||||
TelEngine::destruct(op);
|
||||
}
|
||||
else {
|
||||
const_cast<String&>(op->name()) = (unsigned int)array->m_length++;
|
||||
|
|
Loading…
Reference in New Issue