console: fix -vga none -sdl crash
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 2 Jun 2014 12:07:18 +0000 (14:07 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 10 Jun 2014 10:36:36 +0000 (12:36 +0200)
Call get_alloc_displaystate() for proper initialization
instead of allocating with g_new().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/console.c

index b5dac64..7dc4c14 100644 (file)
@@ -1580,10 +1580,7 @@ DisplayState *init_displaystate(void)
     gchar *name;
     int i;
 
-    if (!display_state) {
-        display_state = g_new0(DisplayState, 1);
-    }
-
+    get_alloc_displaystate();
     for (i = 0; i < nb_consoles; i++) {
         if (consoles[i]->console_type != GRAPHIC_CONSOLE &&
             consoles[i]->ds == NULL) {