Skip to content

Commit

Permalink
Fix #486: should delete Shell object on native window destruction
Browse files Browse the repository at this point in the history
Or the platform events will be sent, and then deleted Shell object
is referred.
  • Loading branch information
rogerwang committed Aug 17, 2013
1 parent cc48f72 commit ad079b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/api/app/app.cc
Expand Up @@ -25,6 +25,7 @@
#include "base/message_loop.h"
#include "base/values.h"
#include "content/nw/src/api/api_messages.h"
#include "content/nw/src/browser/native_window.h"
#include "content/nw/src/browser/net_disk_cache_remover.h"
#include "content/nw/src/nw_package.h"
#include "content/nw/src/nw_shell.h"
Expand Down Expand Up @@ -131,7 +132,9 @@ void App::CloseAllWindows(bool force) {
if (!windows[i]->is_devtools()) {
// If there is no js object bound to the window, then just close.
if (force || windows[i]->ShouldCloseWindow())
delete windows[i];
// we used to delete the Shell object here
// but it should be deleted on native window destruction
windows[i]->window()->Close();
}
}
}
Expand Down

0 comments on commit ad079b5

Please sign in to comment.