Skip to contentSkip to conversation

console: fix -vga none -sdl crash

PATCH In review Gerd Hoffmann 2 participants 2 messages Jun 2, 2014 – Jun 3, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 console: fix -vga none -sdl crash

Call get_alloc_displaystate() for proper initialization instead of allocating with g_new().

---
 ui/console.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
ui/console.c +1 -4
index 3bc18cf..2467ce4 100644
@@ -1547,10 +1547,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) {
Signature · 1 line
1.8.3.1
Tested-by on v1 1/1
#1 lore raw
Quoted 4 lines · Gerd Hoffmann

Call get_alloc_displaystate() for proper initialization instead of allocating with g_new().

Quoted 24 lines

---
ui/console.c | 5 +----

1 file changed, 1 insertion(+), 4 deletions(-)
ui/console.c +1 -4
index 3bc18cf..2467ce4 100644
@@ -1547,10 +1547,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) {
Signature · 1 line
1.8.3.1