]> khamidou — GitHub mirrors - electron.git/commitdiff
Use closed event instead of destroyed event.
authorCheng Zhao <zcbenz@gmail.com>
Wed, 23 Apr 2014 00:50:33 +0000 (08:50 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 23 Apr 2014 00:50:33 +0000 (08:50 +0800)
We now do not delete window manually so the destroyed would be delayed
until the object is GCed.

atom/browser/api/lib/browser-window.coffee
spec/api-browser-window-spec.coffee

index a359b28218ddd53803605d07639133346c78dcb6..94ca508b39591f0db4853540e2b5bf025657cb11 100644 (file)
@@ -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
index 6f8cab50bd21b780225919a7f20486b7f75313c9..c67c873f7daed6f4a1e3ce02dda68e206518594e 100644 (file)
@@ -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)