Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't read mouse status when condition is reached by termination.
[graphlib.git] / DrawingWindow.cpp
index 1ab14ee..7015d6a 100644 (file)
@@ -669,7 +669,7 @@ bool DrawingWindow::waitMousePress(int &x, int &y, int &button,
     if (terminateThread) {
         pressed = false;
     } else {
-        pressed = mouseCondition.wait(&mouseMutex, time);
+        pressed = mouseCondition.wait(&mouseMutex, time) && !terminateThread;
         if (pressed) {
             x = mousePos.x();
             y = mousePos.y();