OnBeforeClose is not being called.

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

OnBeforeClose is not being called.

Postby jonee » Thu Sep 10, 2015 7:07 am

Hi, i am developing cef3 based mac app using cef_binary_3.2357.1289.gc27da0e_macosx64. AppDelegate creates MainWindowController which loads a nib file for main window. Quit code follows the documentation i.e. it overrides terminate in ClientApplication class and calls handler->closeAllBrowsers(false). But application does not quit. I debug the client_handler and found that DoClose is called, but OnBeforeClose is never get called. Any help would be appreciated.


- (BOOL)windowShouldClose:(id)window {
if (g_handler.get() && !g_handler->IsClosing()) {
CefRefPtr<CefBrowser> browser = g_handler->GetBrowser();
if (browser.get()) {
browser->GetHost()->CloseBrowser(false);
return NO;
}
}
// Try to make the window go away.
[window autorelease];
// Clean ourselves up after clearing the stack of anything that might have the
// window on it.
[self performSelectorOnMainThread:@selector(cleanup:)
withObject:window
waitUntilDone:NO];
// Allow the close.
return YES;
}
jonee
Newbie
 
Posts: 1
Joined: Thu Sep 10, 2015 6:56 am

Re: OnBeforeClose is not being called.

Postby Czarek » Mon Nov 16, 2015 10:26 am

See these comments, maye something went wrong in points 6 through 9:
https://bitbucket.org/chromiumembedded/ ... dler.h-146
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 52 guests