diff base/XmlExportable.cpp @ 85:ea730e3f9ace

* Ensure consistent ordering of layer text labels * Fix erroneous SR mismatch warning when adding a wave-file model when no other wave-file model is present (only models that don't assert any particular playback samplerate)
author Chris Cannam
date Thu, 27 Apr 2006 11:49:34 +0000
parents d397ea0a79f5
children 0f37e92e1782
line wrap: on
line diff
--- a/base/XmlExportable.cpp	Wed Apr 26 16:27:34 2006 +0000
+++ b/base/XmlExportable.cpp	Thu Apr 27 11:49:34 2006 +0000
@@ -15,6 +15,8 @@
 
 #include "XmlExportable.h"
 #include <map>
+#include <QMutex>
+#include <QMutexLocker>
 
 QString
 XmlExportable::encodeEntities(QString s)
@@ -49,6 +51,9 @@
 int
 XmlExportable::getObjectExportId(const void * object)
 {
+    static QMutex mutex;
+    QMutexLocker locker(&mutex);
+
     static std::map<const void *, int> idMap;
     static int maxId = 0;