Skip to content

Commit 54bf38f

Browse files
committed
Stop running if window is closed
1 parent d69a111 commit 54bf38f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

26_Autoexposure/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ class AutoexposureApp final : public examples::SimpleWindowedApplication, public
349349

350350
inline bool keepRunning() override
351351
{
352+
// Keep arunning as long as we have a surface to present to (usually this means, as long as the window is open)
353+
if (m_surface->irrecoverable())
354+
return false;
355+
352356
return true;
353357
}
354358

0 commit comments

Comments
 (0)