]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[main] fix bug with multiple deactivate commands
authorScott James Remnant <scott@ubuntu.com>
Thu, 18 Mar 2010 20:27:06 +0000 (20:27 +0000)
committerRay Strode <rstrode@redhat.com>
Mon, 22 Mar 2010 02:14:59 +0000 (22:14 -0400)
If plymouth deactivate is called when we're waiting for the boot
splash to become idle, we end up asserting that there's not
already an idle trigger.

Fix it by checking for an existing deactive trigger, and if there
is, ignoring the new deactivate command (except for pulling its
trigger so it doesn't block).

src/main.c

index 62af0a9205f1dd49fc4f235ed786cad3172572a8..bb8ab4f480a6497745146aa1ced178fa49095651 100644 (file)
@@ -758,10 +758,17 @@ static void
 on_deactivate (state_t       *state,
                ply_trigger_t *deactivate_trigger)
 {
+  if (state->deactivate_trigger != NULL)
+    {
+      ply_trigger_pull (deactivate_trigger, NULL);
+      return;
+    }
+
+  state->deactivate_trigger = deactivate_trigger;
+
   ply_trace ("deactivating");
   if (state->boot_splash != NULL)
     {
-      state->deactivate_trigger = deactivate_trigger;
       ply_boot_splash_become_idle (state->boot_splash,
                                    (ply_boot_splash_on_idle_handler_t)
                                    on_boot_splash_idle,
@@ -769,7 +776,8 @@ on_deactivate (state_t       *state,
     }
   else
     {
-      ply_trigger_pull (deactivate_trigger, NULL);
+      ply_trigger_pull (state->deactivate_trigger, NULL);
+      state->deactivate_trigger = NULL;
     }
 }