diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-15 15:49:20 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-15 15:49:20 -0500 |
commit | 7d8cc6ed5b0e4ffedd55511969001fd28e4aae6c (patch) | |
tree | fd2bfab55d9c2fdb6d1330583143031ff9f36ab3 | |
parent | 2fcd8b3d7b984403f29579691ff96da0e813b6ad (diff) | |
download | qt4-tqt-theme-engine-7d8cc6ed5b0e4ffedd55511969001fd28e4aae6c.tar.gz qt4-tqt-theme-engine-7d8cc6ed5b0e4ffedd55511969001fd28e4aae6c.zip |
Fix potential crash when TDE integration is disabled
-rw-r--r-- | plugin/simplestyle.cpp | 7 | ||||
-rw-r--r-- | 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; |