summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-12-06 15:08:56 -0600
committerSlávek Banko <slavek.banko@axis.cz>2015-12-15 19:54:03 +0100
commitf7fcc6acb722277e11e813d3ce97ee9f01679921 (patch)
tree8a01d6dd24ec85528ba1a6be9568a93a14bf4fd9
parent92cad529ea598e195afbeb046df517b98e143dff (diff)
downloadqt3-f7fcc6acb722277e11e813d3ce97ee9f01679921.tar.gz
qt3-f7fcc6acb722277e11e813d3ce97ee9f01679921.zip
Try to avoid crashes if the destructor of a TQMap is called when no private object was previously created
(cherry picked from commit 997490223743e3bd40c3cedf5dc799243c6dad9e)
-rw-r--r--src/tools/qmap.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tools/qmap.h b/src/tools/qmap.h
index 4f9772f..a785832 100644
--- a/src/tools/qmap.h
+++ b/src/tools/qmap.h
@@ -644,8 +644,12 @@ public:
#endif
~QMap()
{
- if ( sh->deref() )
- delete sh;
+ if ( sh ) {
+ if ( sh->deref() ) {
+ delete sh;
+ sh = 0L;
+ }
+ }
}
QMap<Key,T>& operator= ( const QMap<Key,T>& m );
#ifndef QT_NO_STL