From 124da0f5e6733b0f9f87367306c6d7c0b9513685 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 30 Apr 2013 10:59:15 +0200 Subject: [PATCH] Fix possible segfault when setting up window's transient parent tp->handle() can be null. Task-number: QTBUG-30919 Change-Id: Ie18b70d4cc6916d2e821a71d00d1bf99956b0632 Reviewed-by: Liang Qi --- src/plugins/platforms/xcb/qxcbwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index c845b875bf..6291396e6e 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -630,7 +630,7 @@ void QXcbWindow::show() const QWindow *tp = window()->transientParent(); if (isTransient(window()) || tp != 0) { xcb_window_t transientXcbParent = 0; - if (tp) + if (tp && tp->handle()) transientXcbParent = static_cast(tp->handle())->winId(); // Default to client leader if there is no transient parent, else modal dialogs can // be hidden by their parents.