mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 942480: Don't js_delete a freshly allocated js::Debugger, if we've stored it in the Debugger JSObject's private slot. r=shu
This commit is contained in:
parent
19850f7261
commit
8a825633a5
@ -2126,14 +2126,16 @@ Debugger::construct(JSContext *cx, unsigned argc, Value *vp)
|
||||
for (unsigned slot = JSSLOT_DEBUG_PROTO_START; slot < JSSLOT_DEBUG_PROTO_STOP; slot++)
|
||||
obj->setReservedSlot(slot, proto->getReservedSlot(slot));
|
||||
|
||||
/* Construct the underlying C++ object. */
|
||||
Debugger *dbg = cx->new_<Debugger>(cx, obj.get());
|
||||
if (!dbg)
|
||||
return false;
|
||||
obj->setPrivate(dbg);
|
||||
if (!dbg->init(cx)) {
|
||||
js_delete(dbg);
|
||||
return false;
|
||||
}
|
||||
obj->setPrivate(dbg);
|
||||
/* Now the JSObject owns the js::Debugger instance, so we needn't delete it. */
|
||||
|
||||
/* Add the initial debuggees, if any. */
|
||||
for (unsigned i = 0; i < argc; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user