From 51d2e7756e33ee510fdcf53d5e2ae6f96f2b1c70 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 16 Sep 2009 15:32:17 +0200 Subject: Don't crash on exit if the X11 clipboard owner has not been created. Owner can be null, don't try to deref it if it is. --- src/gui/kernel/qclipboard_x11.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp index 5495bfe..9621944 100644 --- a/src/gui/kernel/qclipboard_x11.cpp +++ b/src/gui/kernel/qclipboard_x11.cpp @@ -916,7 +916,8 @@ bool QClipboard::event(QEvent *e) // That means application exits and we need to give clipboard // content to the clipboard manager. // First we check if there is a clipboard manager. - if (XGetSelectionOwner(X11->display, ATOM(CLIPBOARD_MANAGER)) == XNone) + if (XGetSelectionOwner(X11->display, ATOM(CLIPBOARD_MANAGER)) == XNone + || !owner) return true; Window ownerId = owner->internalWinId(); -- cgit v0.12