From: Scott James Remnant Date: Thu, 18 Mar 2010 20:27:06 +0000 (+0000) Subject: [main] fix bug with multiple deactivate commands X-Git-Tag: 0.8.0~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=434a4b2ae8a52bed5053c148e1819306f0f8aa06;p=thirdparty%2Fplymouth.git [main] fix bug with multiple deactivate commands 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). --- diff --git a/src/main.c b/src/main.c index 62af0a92..bb8ab4f4 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; } }