Avoid a crash if trying to do two screen switches at once.

Managed to make this happen while using the UWP File Open dialog - it
lagged and I started another action while it hadn't returned.
This commit is contained in:
Henrik Rydgård committed 2017-03-07 15:33:23 +01:00
1 parent ee48a075b0
commit 529d84a57b
1 file changed
+3 -1
+3 -1
View File
@@ -25,7 +25,9 @@ void ScreenManager::switchScreen(Screen *screen) {
// until that switch.
// TODO: is this still true?
if (nextScreen_ != 0) {
FLOG("Already had a nextScreen_");
ELOG("Already had a nextScreen_! Asynchronous open while doing something? Deleting the new screen.");
delete screen;
return;
}
if (screen == 0) {
WLOG("Swiching to a zero screen, this can't be good");