Ensure closing the application will call window.shutdown on each window.

This commit is contained in:
Corey Johnson
2012-11-07 15:45:37 -08:00
parent e96d1b07d3
commit 1850da70e3
2 changed files with 4 additions and 5 deletions

View File

@@ -171,10 +171,8 @@
}
- (void)applicationWillTerminate:(NSNotification *)notification {
NSInteger windowCount = [[self windows] count];
for(int i = 0; i < windowCount; i++) {
NSWindow *window = [[self windows] objectAtIndex:i];
[window performClose:0];
for (NSWindow *window in [self windows]) {
[window performClose:self];
}
CefShutdown();
}

View File

@@ -164,11 +164,12 @@
}
}
- (void)windowWillClose:(NSNotification *)notification {
- (BOOL)windowShouldClose:(NSNotification *)notification {
if (_cefClient && _cefClient->GetBrowser()) {
_cefClient->GetBrowser()->SendProcessMessage(PID_RENDERER, CefProcessMessage::Create("shutdown"));
}
[self autorelease];
return YES;
}
- (void)populateBrowserSettings:(CefBrowserSettings &)settings {