diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-09-06 13:05:37 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-09-06 13:05:37 +0200 |
| commit | 8b9cc9a8dbebc0dc988a97d95c49cce2993529e1 (patch) | |
| tree | ffc456ef71bb02f9b3a17a220d6a75a8d6e0b63d /src/managers/AnimationManager.cpp | |
| parent | 37e2311a3e4124930e1a66de8f8de040f9b7571c (diff) | |
animationmgr: guard monitor ptr in animationSlide
Diffstat (limited to 'src/managers/AnimationManager.cpp')
| -rw-r--r-- | src/managers/AnimationManager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index 4172a1ff..64cb1c0c 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -343,7 +343,10 @@ void CAnimationManager::animationSlide(CWindow* pWindow, std::string force, bool const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID); - Vector2D posOffset; + if (!PMONITOR) + return; // unsafe state most likely + + Vector2D posOffset; if (force != "") { if (force == "bottom") @@ -544,7 +547,7 @@ void CAnimationManager::scheduleTick() { return; } - float refreshDelayMs = std::floor(1000.f / PMOSTHZ->refreshRate); + float refreshDelayMs = std::floor(1000.f / PMOSTHZ->refreshRate); const float SINCEPRES = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now() - PMOSTHZ->lastPresentationTimer.chrono()).count() / 1000.f; |
