Use closed event instead of destroyed event.
We now do not delete window manually so the destroyed would be delayed until the object is GCed.
This commit is contained in:
parent
5a316c0c41
commit
5037daadfb
2 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ BrowserWindow::_init = ->
|
|||
|
||||
# Remove the window from weak map immediately when it's destroyed, since we
|
||||
# could be iterating windows before GC happended.
|
||||
@once 'destroyed', ->
|
||||
@once 'closed', ->
|
||||
BrowserWindow.windows.remove id if BrowserWindow.windows.has id
|
||||
|
||||
# Tell the rpc server that a render view has been deleted and we need to
|
||||
|
|
|
@ -14,7 +14,7 @@ describe 'browser-window module', ->
|
|||
w.on 'loading-state-changed', (event, isLoading) ->
|
||||
if (!isLoading)
|
||||
w.close()
|
||||
w.on 'destroyed', ->
|
||||
w.on 'closed', ->
|
||||
test = path.join(fixtures, 'api', 'unload')
|
||||
content = fs.readFileSync(test)
|
||||
fs.unlinkSync(test)
|
||||
|
|
Loading…
Add table
Reference in a new issue