summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2cbb388)
raw | patch | inline | side by side (parent: 2cbb388)
author | Max Kellermann <max@duempel.org> | |
Wed, 17 Sep 2008 10:08:06 +0000 (12:08 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Wed, 17 Sep 2008 10:08:06 +0000 (12:08 +0200) |
When the selected screen does not exist, return before calling
close().
close().
src/screen.c | patch | blob | history |
diff --git a/src/screen.c b/src/screen.c
index a55b2cf825e3ed3f6218ecf295d86f1f61f59b27..0c59d6940ea36d82024c828885c443ac003aebea 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
if( id == screens[screen.mode].id )
return;
+ new_mode = lookup_mode(id);
+ if (new_mode < 0)
+ return;
+
/* close the old mode */
if (mode_fn->close != NULL)
mode_fn->close();
/* get functions for the new mode */
- new_mode = lookup_mode(id);
- if (new_mode >= 0) {
- D("switch_screen(%s)\n", screens[new_mode].name );
- mode_fn = screens[new_mode].functions;
- screen.mode = new_mode;
- }
-
+ D("switch_screen(%s)\n", screens[new_mode].name );
+ mode_fn = screens[new_mode].functions;
+ screen.mode = new_mode;
screen.painted = 0;
/* open the new mode */