mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-16 07:18:52 +02:00
Fixed a race condition that sometimes caused the main menus not to appear.
When Interface starts, it first calls pauseUntilLoginDetermined(), and later resumeAfterLoginDialogActionTaken(). But on rare occasions these functions are called in the reverse order, and this caused Interface to remain in the "paused" state. Now we check for this case, and abort pauseUntilLoginDetermined() if it happens. This has only happened to me when running Interface immediately after rebuilding it (in Release mode).
This commit is contained in:
parent
8e201f4801
commit
49165056c9
2 changed files with 12 additions and 0 deletions
|
@ -5414,6 +5414,13 @@ void Application::pauseUntilLoginDetermined() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (_resumeAfterLoginDialogActionTakenWasCalled) {
|
||||
// This happens occasionally (though not often): resumeAfterLoginDialogActionTaken() has already been called.
|
||||
// We must abort this method, otherwise Interface will remain in the "Paused" state permanently.
|
||||
// E.g., the menus "Edit", "View", etc. will not appear.
|
||||
return;
|
||||
}
|
||||
|
||||
auto myAvatar = getMyAvatar();
|
||||
_previousAvatarTargetScale = myAvatar->getTargetScale();
|
||||
_previousAvatarSkeletonModel = myAvatar->getSkeletonModelURL().toString();
|
||||
|
@ -5528,6 +5535,8 @@ void Application::resumeAfterLoginDialogActionTaken() {
|
|||
menu->getMenu("Developer")->setVisible(_developerMenuVisible);
|
||||
_myCamera.setMode(_previousCameraMode);
|
||||
cameraModeChanged();
|
||||
|
||||
_resumeAfterLoginDialogActionTakenWasCalled = true;
|
||||
}
|
||||
|
||||
void Application::loadAvatarScripts(const QVector<QString>& urls) {
|
||||
|
|
|
@ -802,5 +802,8 @@ private:
|
|||
|
||||
bool _showTrackedObjects { false };
|
||||
bool _prevShowTrackedObjects { false };
|
||||
|
||||
// Whether resumeAfterLoginDialogActionTaken() has been called
|
||||
bool _resumeAfterLoginDialogActionTakenWasCalled { false };
|
||||
};
|
||||
#endif // hifi_Application_h
|
||||
|
|
Loading…
Reference in a new issue