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 <liang.qi@digia.com>
This commit is contained in:
Shawn Rutledge 2013-04-30 10:59:15 +02:00 committed by The Qt Project
parent dc5a579a16
commit 124da0f5e6

View File

@ -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<const QXcbWindow *>(tp->handle())->winId();
// Default to client leader if there is no transient parent, else modal dialogs can
// be hidden by their parents.