From 7d8cc6ed5b0e4ffedd55511969001fd28e4aae6c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 15 Sep 2012 15:49:20 -0500 Subject: [PATCH] Fix potential crash when TDE integration is disabled --- plugin/simplestyle.cpp | 7 +++++-- plugin/simplestyle.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugin/simplestyle.cpp b/plugin/simplestyle.cpp index 583d4bd..739b4c6 100644 --- a/plugin/simplestyle.cpp +++ b/plugin/simplestyle.cpp @@ -134,7 +134,7 @@ static QString TDEFileDialogSelectDirectory(QWidget *parent, const QString &capt #define NO_QT3_EQUIVALENT can_override = false; #define DO_NOT_DRAW can_override = true; do_not_draw = true; -Qt4TDEStyle::Qt4TDEStyle() : m_aboutData(NULL), m_tdeApplication(NULL) +Qt4TDEStyle::Qt4TDEStyle() : m_aboutData(NULL), m_tqApplication(NULL), m_tdeApplication(NULL) { enable_debug_warnings = (getenv("DEBUG_TDEQT4_THEME_ENGINE") != NULL); @@ -191,7 +191,7 @@ Qt4TDEStyle::Qt4TDEStyle() : m_aboutData(NULL), m_tdeApplication(NULL) if (!tqApp) { // Qt4 can be SO STUPID sometimes...why can't I get the X11 display directly from qApp?!?!?? QWidget myhackedwidget; - new TQApplication(myhackedwidget.x11Info().display()); + m_tqApplication = new TQApplication(myhackedwidget.x11Info().display()); } // Set up Qt4 size hints to match the hardcoded TQt3 sizes @@ -266,6 +266,9 @@ Qt4TDEStyle::~Qt4TDEStyle() if (m_tdeApplication) { delete m_tdeApplication; } + if (m_tqApplication) { + delete m_tqApplication; + } // FIXME // Do I need to delete this? diff --git a/plugin/simplestyle.h b/plugin/simplestyle.h index e4c7923..e8799ce 100644 --- a/plugin/simplestyle.h +++ b/plugin/simplestyle.h @@ -107,6 +107,7 @@ private: mutable TQWidget* m_previousTQt3InterfaceWidget; KAboutData* m_aboutData; + TQApplication* m_tqApplication; KApplication* m_tdeApplication; TQString m_qt4ApplicationName;