summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-30 23:51:15 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-30 23:51:15 +0000
commit81516d6ea9c90491af15ee7009c449d253a89ec6 (patch)
tree899ca738c077d9e9a3e5a73906b490c5961e1827
parent571aa8f8604465b5bb15be89fff102b023cefe1f (diff)
downloadchromium_src-81516d6ea9c90491af15ee7009c449d253a89ec6.zip
chromium_src-81516d6ea9c90491af15ee7009c449d253a89ec6.tar.gz
chromium_src-81516d6ea9c90491af15ee7009c449d253a89ec6.tar.bz2
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
-rw-r--r--base/message_pump_glib_x.cc6
1 files changed, 6 insertions, 0 deletions
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;