Skip to content
Snippets Groups Projects
Commit 63e9e456 authored by Mathieu Geisert (old)'s avatar Mathieu Geisert (old)
Browse files

Lock mutex when writing/reading newNodeConfigurations (remove error when...

Lock mutex when writing/reading newNodeConfigurations (remove error when multi-threads client is calling "refresh" and "applyConfiguration" at the same time).
parent 7e0bb44d
No related branches found
No related tags found
No related merge requests found
...@@ -203,8 +203,8 @@ namespace graphics { ...@@ -203,8 +203,8 @@ namespace graphics {
for (WindowManagers_t::iterator it = windowManagers_.begin (); for (WindowManagers_t::iterator it = windowManagers_.begin ();
it!=windowManagers_.end (); ++it) it!=windowManagers_.end (); ++it)
(*it)->frame (); (*it)->frame ();
mtx_.unlock ();
newNodeConfigurations_.clear (); newNodeConfigurations_.clear ();
mtx_.unlock ();
} catch (const std::exception& exc) { } catch (const std::exception& exc) {
throw Error (exc.what ()); throw Error (exc.what ());
} }
...@@ -704,8 +704,10 @@ namespace graphics { ...@@ -704,8 +704,10 @@ namespace graphics {
"quatY, quatZ]" <<std::endl; "quatY, quatZ]" <<std::endl;
return false; return false;
} }
mtx_.lock();
newNodeConfigurations_.push_back (newNodeConfiguration); newNodeConfigurations_.push_back (newNodeConfiguration);
return true; mtx_.unlock();
return true;
} }
} catch (const std::exception& exc) { } catch (const std::exception& exc) {
throw Error (exc.what ()); throw Error (exc.what ());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment