Tell browser to release remote object when the object is GCed.
This commit is contained in:
parent
cc37431a1f
commit
3f6f2f4bea
2 changed files with 9 additions and 0 deletions
|
@ -45,8 +45,14 @@ generateFromPainObject = (plain) ->
|
|||
ret = ipc.sendChannelSync 'ATOM_INTERNAL_MEMBER_GET', plain.id, member.name
|
||||
generateFromPainObject ret
|
||||
|
||||
# Track delegate object's life time, and tell the browser to clean up
|
||||
# when the object is GCed.
|
||||
v8_util.setDestructor ret, ->
|
||||
ipc.sendChannel 'ATOM_INTERNAL_DESTROY', plain.id
|
||||
|
||||
ret
|
||||
|
||||
# Get remote module.
|
||||
exports.require = (module) ->
|
||||
plain = ipc.sendChannelSync 'ATOM_INTERNAL_REQUIRE', module
|
||||
generateFromPainObject plain
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue