Fix close view crash

When playing with !436 (merged) I noticed that very rarely when QT View is closed, there is a segmentation fault. I located the problem to GLLock in GLViewer.cpp. The doneCurrent() is sometimes called after the GLViewer instance is destroyed.

While fixing this I had to replace a couple more boost::mutex with std::mutex.

Do we have an issue report that there is a crash when a QT View is closed? When I finish this, we could close such issue.

EDIT: OK, it turned out that also QWindow, QWidget classes wanted to say 'farewell' to the closed window. And they did this after it was destroyed, which caused the crash. I fixed this problem by postponing the deletion of window until deleteLater() is called from the QT event queue. Now when I run yade -f6 ./simple-scene.py and open and close window many times I am unable to reproduce the crash. Please try this.

Edited by Janek Kozicki

Merge request reports

Loading