From 3c25c7d62028c14196ce25a7035a749a61c251f3 Mon Sep 17 00:00:00 2001 From: coolo Date: Sun, 9 Dec 2007 18:53:51 +0000 Subject: [PATCH] avoid crash on exit - that is also reproducible in qt3 git-svn-id: http://svn.opensuse.org/svn/yast/trunk/qt4@42879 e0cc52ee-31ee-0310-8b87-e83c4596d67c --- src/YQDialog.cc | 4 ++++ src/YQGenericButton.cc | 5 +++++ src/YQGenericButton.h | 5 ++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/YQDialog.cc b/src/YQDialog.cc index 9e56d2d..e7cc370 100644 --- a/src/YQDialog.cc +++ b/src/YQDialog.cc @@ -95,6 +95,10 @@ YQDialog::~YQDialog() { YQMainWinDock::mainWinDock()->remove( this ); } + if ( _defaultButton ) + _defaultButton->forgetDialog(); + if ( _focusButton ) + _focusButton->forgetDialog(); } diff --git a/src/YQGenericButton.cc b/src/YQGenericButton.cc index 8ee4294..a0391ed 100644 --- a/src/YQGenericButton.cc +++ b/src/YQGenericButton.cc @@ -68,6 +68,11 @@ YQGenericButton::~YQGenericButton() } } +void +YQGenericButton::forgetDialog() +{ + _dialog = 0; +} YQDialog * YQGenericButton::dialog() diff --git a/src/YQGenericButton.h b/src/YQGenericButton.h index edb8d9d..6e85992 100644 --- a/src/YQGenericButton.h +++ b/src/YQGenericButton.h @@ -37,6 +37,8 @@ using std::string; **/ class YQGenericButton : public QWidget, public YPushButton { + friend class YQDialog; + Q_OBJECT protected: @@ -156,7 +158,8 @@ protected: **/ YQDialog * dialog(); - + void forgetDialog(); + private: YQDialog * _dialog; -- 2.39.2