Linux: Fix BadWindow error when creating popup windows (issue #1717).

This commit is contained in:
Marshall Greenblatt 2015-10-14 09:44:22 -07:00
parent 16f8a66040
commit fdf3088470
2 changed files with 9 additions and 7 deletions

View File

@ -48,8 +48,10 @@ void BrowserWindow::OnBrowserClosing(CefRefPtr<CefBrowser> browser) {
void BrowserWindow::OnBrowserClosed(CefRefPtr<CefBrowser> browser) {
REQUIRE_MAIN_THREAD();
DCHECK_EQ(browser->GetIdentifier(), browser_->GetIdentifier());
browser_ = NULL;
if (browser_.get()) {
DCHECK_EQ(browser->GetIdentifier(), browser_->GetIdentifier());
browser_ = NULL;
}
client_handler_->DetachDelegate();
client_handler_ = NULL;

View File

@ -88,11 +88,6 @@ int RunMain(int argc, char* argv[]) {
// Populate the settings based on command line arguments.
context->PopulateSettings(&settings);
// Install xlib error handlers so that the application won't be terminated
// on non-fatal errors.
XSetErrorHandler(XErrorHandlerImpl);
XSetIOErrorHandler(XIOErrorHandlerImpl);
// Create the main message loop object.
scoped_ptr<MainMessageLoop> message_loop(new MainMessageLoopStd);
@ -106,6 +101,11 @@ int RunMain(int argc, char* argv[]) {
// Perform gtkglext initialization required by the OSR example.
gtk_gl_init(&argc, &argv_copy);
// Install xlib error handlers so that the application won't be terminated
// on non-fatal errors. Must be done after initializing GTK.
XSetErrorHandler(XErrorHandlerImpl);
XSetIOErrorHandler(XIOErrorHandlerImpl);
// Install a signal handler so we clean up after ourselves.
signal(SIGINT, TerminationSignalHandler);
signal(SIGTERM, TerminationSignalHandler);