[PATCH 03/20] [main] fix bug with multiple deactivate commands

Scott James Remnant scott at ubuntu.com
Thu Mar 18 13:27:06 PDT 2010


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 |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/main.c b/src/main.c
index 62af0a9..bb8ab4f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
     }
 }
 
-- 
1.7.0



More information about the plymouth mailing list