Commit 8df026ea authored by Mike Kremer's avatar Mike Kremer

Added mutex in order to prevent concurrent operations on std::map.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12229 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0ffbaeb6
......@@ -945,6 +945,9 @@ public:
// Store pointers to QFuture and QFutureWatcher
std::map<QFutureWatcher<void>*,QFuture<void>*> watcher_garbage_;
// Mutex for operations on map
QMutex map_mutex_;
private slots:
void delete_garbage();
......
......@@ -750,6 +750,9 @@ void CoreWidget::delete_garbage() {
if(!watcher) {
return;
}
map_mutex_.lock();
std::map<QFutureWatcher<void>*,QFuture<void>*>::iterator f;
f = watcher_garbage_.find(watcher);
if(f != watcher_garbage_.end()) {
......@@ -757,6 +760,8 @@ void CoreWidget::delete_garbage() {
delete f->first;
watcher_garbage_.erase(f);
}
map_mutex_.unlock();
}
void CoreWidget::slotPasteView( ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment