Branch: master

99749022 2014-12-06 15:08:56 Timothy Pearson
Try to avoid crashes if the destructor of a TQMap is called when no private object was previously created
M src/tools/qmap.h
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 @@
 #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