From 81516d6ea9c90491af15ee7009c449d253a89ec6 Mon Sep 17 00:00:00 2001 From: "sadrul@chromium.org" Date: Thu, 30 Dec 2010 23:51:15 +0000 Subject: touch: Check for NULL display. The display can be NULL when, for example, the message pump is created for a plugin. BUG=none TEST=none TBR=sadrul@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70325 0039d316-1c4b-4281-b951-d872f2087c98 --- base/message_pump_glib_x.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/base/message_pump_glib_x.cc b/base/message_pump_glib_x.cc index 26c4b87..775e940 100644 --- a/base/message_pump_glib_x.cc +++ b/base/message_pump_glib_x.cc @@ -84,6 +84,9 @@ MessagePumpGlibX::~MessagePumpGlibX() { bool MessagePumpGlibX::RunOnce(GMainContext* context, bool block) { GdkDisplay* gdisp = gdk_display_get_default(); + if (!gdisp) + return MessagePumpForUI::RunOnce(context, block); + Display* display = GDK_DISPLAY_XDISPLAY(gdisp); bool should_quit = false; @@ -189,6 +192,9 @@ void MessagePumpGlibX::InitializeEventsToCapture(void) { #if defined(HAVE_XINPUT2) void MessagePumpGlibX::InitializeXInput2(void) { GdkDisplay* display = gdk_display_get_default(); + if (!display) + return; + Display* xdisplay = GDK_DISPLAY_XDISPLAY(display); int event, err; -- cgit v1.1