Fix Interface eating memory when minimized

This commit is contained in:
David Rowe 2018-10-27 11:40:02 +13:00
parent 2dfd63f4e7
commit 1cca975b37

View file

@ -6017,7 +6017,9 @@ void Application::update(float deltaTime) {
{
PROFILE_RANGE_EX(app, "Overlays", 0xffff0000, (uint64_t)getActiveDisplayPlugin()->presentCount());
PerformanceTimer perfTimer("overlays");
_overlays.update(deltaTime);
if (qApp->shouldPaint()) {
_overlays.update(deltaTime);
}
}
// Update _viewFrustum with latest camera and view frustum data...
@ -6102,8 +6104,10 @@ void Application::update(float deltaTime) {
PROFILE_RANGE_EX(app, "PostUpdateLambdas", 0xffff0000, (uint64_t)0);
PerformanceTimer perfTimer("postUpdateLambdas");
std::unique_lock<std::mutex> guard(_postUpdateLambdasLock);
for (auto& iter : _postUpdateLambdas) {
iter.second();
if (qApp->shouldPaint()) {
for (auto& iter : _postUpdateLambdas) {
iter.second();
}
}
_postUpdateLambdas.clear();
}