mirror of
https://github.com/servo/servo.git
synced 2025-06-13 02:44:29 +00:00
Only unwrap the object once when finalizing.
Previously, we had 'value' and 'this' locals, both storing a pointer to the DOM object, for no good reason.
This commit is contained in:
parent
a5f52bf086
commit
c12b4029aa
1 changed files with 2 additions and 3 deletions
|
@ -4040,10 +4040,9 @@ let this: *const %s = unwrap::<%s>(obj);
|
|||
|
||||
def finalizeHook(descriptor, hookName, context):
|
||||
release = """\
|
||||
let value = unwrap::<%s>(obj);
|
||||
let _ = Box::from_raw(value as *mut %s);
|
||||
let _ = Box::from_raw(this as *mut %s);
|
||||
debug!("%s finalize: {:p}", this);\
|
||||
""" % (descriptor.concreteType, descriptor.concreteType, descriptor.concreteType)
|
||||
""" % (descriptor.concreteType, descriptor.concreteType)
|
||||
return release
|
||||
|
||||
class CGClassTraceHook(CGAbstractClassHook):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue