Allow renderer to get object in browser for arbitrary times.
Now, when creating a remote object in renderer, the browser will reference the corresponding object by storing it in a strong map. And when the remote object in renderer is GCed, the corresponding object will be dereferenced in browser.
This commit is contained in:
parent
536b523232
commit
da3d4c8408
3 changed files with 50 additions and 35 deletions
|
@ -48,7 +48,7 @@ generateFromPainObject = (plain) ->
|
|||
# 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
|
||||
ipc.sendChannel 'ATOM_INTERNAL_DEREFERENCE', plain.storeId
|
||||
|
||||
ret
|
||||
|
||||
|
@ -59,5 +59,5 @@ exports.require = (module) ->
|
|||
|
||||
# Get object with specified id.
|
||||
exports.getObject = (id) ->
|
||||
plain = ipc.sendChannelSync 'ATOM_INTERNAL_GET_OBJECT', id
|
||||
plain = ipc.sendChannelSync 'ATOM_INTERNAL_REFERENCE', id
|
||||
generateFromPainObject plain
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue