]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[main] clean up terminal when done with it
authorRay Strode <rstrode@redhat.com>
Tue, 6 Oct 2009 20:47:41 +0000 (16:47 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 6 Oct 2009 20:47:41 +0000 (16:47 -0400)
Before we were relying on the renderer to clean
up the terminal, which was wrong.

src/main.c

index e827da42dea7fb0bb9d53116eb3ce690152cea0b..31f2b1e29d007599bb2f00088d7ab1c30938647d 100644 (file)
@@ -94,6 +94,7 @@ typedef struct
   ply_command_parser_t *command_parser;
   ply_mode_t mode;
   ply_renderer_t *renderer;
+  ply_terminal_t *terminal;
 
   ply_trigger_t *quit_trigger;
 
@@ -608,6 +609,13 @@ quit_splash (state_t *state)
       state->renderer = NULL;
     }
 
+  if (state->terminal != NULL)
+    {
+      ply_terminal_close (state->terminal);
+      ply_terminal_free (state->terminal);
+      state->terminal = NULL;
+    }
+
   ply_trace ("removing displays and keyboard");
   remove_displays_and_keyboard (state);
 
@@ -935,6 +943,8 @@ add_display_and_keyboard_for_terminal (state_t    *state,
       return;
     }
 
+  state->terminal = terminal;
+
   ply_console_set_active_vt (state->console,
                              ply_terminal_get_vt_number (terminal));
 
@@ -1005,6 +1015,8 @@ add_default_displays_and_keyboard (state_t *state)
       return;
     }
 
+  state->terminal = terminal;
+
   keyboard = ply_keyboard_new_for_renderer (renderer);
   set_keyboard (state, keyboard);