Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix more QMutexLocker usage. #952

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Gui/ViewerGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ ViewerGL::resizeGL(int w,
bool zoomSinceLastFit;
double oldWidth, oldHeight;
{
QMutexLocker(&_imp->zoomCtxMutex);
QMutexLocker l(&_imp->zoomCtxMutex);
oldWidth = _imp->zoomCtx.screenWidth();
oldHeight = _imp->zoomCtx.screenHeight();
_imp->zoomCtx.setScreenSize(zoomWidth, zoomHeight, /*alignTop=*/ true, /*alignRight=*/ false);
Expand Down Expand Up @@ -2911,7 +2911,7 @@ ViewerGL::fitImageToFormat()
double zoomFactor;
unsigned int oldMipmapLevel, newMipmapLevel;
{
QMutexLocker(&_imp->zoomCtxMutex);
QMutexLocker l(&_imp->zoomCtxMutex);
old_zoomFactor = _imp->zoomCtx.factor();
//oldMipmapLevel = std::log( old_zoomFactor >= 1 ? 1 :
// std::pow( 2, -std::ceil(std::log(old_zoomFactor) / M_LN2) ) ) / M_LN2;
Expand Down Expand Up @@ -3467,7 +3467,7 @@ ViewerGL::setUserRoIEnabled(bool b)
// always running in the main thread
assert( qApp && qApp->thread() == QThread::currentThread() );
{
QMutexLocker(&_imp->userRoIMutex);
QMutexLocker l(&_imp->userRoIMutex);
_imp->userRoIEnabled = b;
}
if (!b) {
Expand Down Expand Up @@ -3568,7 +3568,7 @@ bool
ViewerGL::isUserRegionOfInterestEnabled() const
{
// MT-SAFE
QMutexLocker(&_imp->userRoIMutex);
QMutexLocker l(&_imp->userRoIMutex);

return _imp->userRoIEnabled;
}
Expand All @@ -3577,7 +3577,7 @@ RectD
ViewerGL::getUserRegionOfInterest() const
{
// MT-SAFE
QMutexLocker(&_imp->userRoIMutex);
QMutexLocker l(&_imp->userRoIMutex);

return _imp->userRoI;
}
Expand All @@ -3586,7 +3586,7 @@ void
ViewerGL::setUserRoI(const RectD & r)
{
// MT-SAFE
QMutexLocker(&_imp->userRoIMutex);
QMutexLocker l(&_imp->userRoIMutex);
_imp->userRoI = r;
}

Expand Down