From 7081b7aecb63270103c4f41f3a020842993dce90 Mon Sep 17 00:00:00 2001 From: Martin Kampas Date: Fri, 20 Nov 2015 12:41:24 +0100 Subject: [PATCH] PathChooser: Fix segfault on destruction I was only able to crash it with the Mer plugin (not in tree). Change-Id: Ie478f74c48ac6686418207fd1af8b727bcfed3cd Reviewed-by: Tobias Hunger --- src/libs/utils/pathchooser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 997f4c2f76f..42889793958 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -250,6 +250,10 @@ PathChooser::PathChooser(QWidget *parent) : PathChooser::~PathChooser() { + // Since it is our focusProxy it can receive focus-out and emit the signal + // even when the possible ancestor-receiver is in mid of its destruction. + disconnect(d->m_lineEdit, &QLineEdit::editingFinished, this, &PathChooser::editingFinished); + delete d; }