the case where the removed child has no other referants, otherwise it
will be deleted on function exit. Also give the ghost type a name for
cleaner debugging.
delete prop;
}
-naGhostType PropNodeGhostType = { propNodeGhostDestroy };
+naGhostType PropNodeGhostType = { propNodeGhostDestroy, "prop" };
static naRef propNodeGhostCreate(naContext c, SGPropertyNode* n)
{
naRef child = naVec_get(argv, 0);
naRef index = naVec_get(argv, 1);
if(!naIsString(child) || !naIsNum(index)) return naNil();
- SGPropertyNode* n = 0;
+ SGPropertyNode_ptr n = 0;
try {
n = (*node)->removeChild(naStr_data(child), (int)index.num, false);
} catch (const string& err) {