Revert "Make BrowserWindow inheritable. Fixed #23."
This reverts commit 5a0aab2e4f
.
This commit is contained in:
parent
3d267e2a9f
commit
dbaf8860a6
6 changed files with 47 additions and 95 deletions
|
@ -47,11 +47,18 @@ objectsWeakMap.add = (obj) ->
|
|||
|
||||
windowsWeakMap = new IDWeakMap
|
||||
|
||||
process.on 'ATOM_BROWSER_INTERNAL_NEW_BROWSER_WINDOW', (obj) ->
|
||||
# Remember all windows.
|
||||
id = windowsWeakMap.add obj
|
||||
obj.on 'destroyed', ->
|
||||
windowsWeakMap.remove id
|
||||
process.on 'ATOM_BROWSER_INTERNAL_NEW', (obj) ->
|
||||
# It's possible that user created a object in browser side and then want to
|
||||
# get it in renderer via remote.getObject. So we must add every native object
|
||||
# created in browser to the weak map even it may not be referenced by the
|
||||
# renderer.
|
||||
objectsWeakMap.add obj
|
||||
|
||||
# Also remember all windows.
|
||||
if obj.constructor is BrowserWindow
|
||||
id = windowsWeakMap.add obj
|
||||
obj.on 'destroyed', ->
|
||||
windowsWeakMap.remove id
|
||||
|
||||
exports.add = (processId, routingId, obj) ->
|
||||
# Some native objects may already been added to objectsWeakMap, be care not
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue