]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Remove event handlers on destroy in plugins
authorRay Strode <rstrode@redhat.com>
Mon, 9 Mar 2009 16:18:56 +0000 (12:18 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 9 Mar 2009 16:28:27 +0000 (12:28 -0400)
This is because we can end up in scenarios
where a plugin gets destroyed, and readded
without getting hidden in between.

src/plugins/splash/details/plugin.c
src/plugins/splash/fade-in/plugin.c
src/plugins/splash/glow/plugin.c
src/plugins/splash/pulser/plugin.c
src/plugins/splash/solar/plugin.c
src/plugins/splash/spinfinity/plugin.c
src/plugins/splash/text/plugin.c

index c25b75ac1c74864d38236b1e40caee5a066d6500..2eed3418dd972ea4b6052fe0ef433987c7d1203f 100644 (file)
@@ -64,6 +64,14 @@ typedef enum {
 
 typedef void (* ply_boot_splash_plugin_window_handler_t) (ply_window_t *window, ply_boot_splash_plugin_t *, void *user_data, void *other_user_data);
 
+static void uninitialize_window (ply_window_t             *window,
+                                 ply_boot_splash_plugin_t *plugin);
+
+static void for_each_window (ply_boot_splash_plugin_t *plugin,
+                             ply_boot_splash_plugin_window_handler_t handler,
+                             void *user_data,
+                             void *other_user_data);
+
 ply_boot_splash_plugin_interface_t *ply_boot_splash_plugin_get_interface (void);
 struct _ply_boot_splash_plugin
 {
@@ -94,6 +102,10 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin)
   if (plugin == NULL)
     return;
 
+  for_each_window (plugin,
+                   (ply_boot_splash_plugin_window_handler_t)
+                   uninitialize_window, NULL, NULL);
+
   ply_list_free (plugin->windows);
 
   free (plugin);
index 598bc08ad511e33397cb3f1ef83b200d419f81aa..f06f49881674297bcd86e35609a09d0b518f5882 100644 (file)
@@ -167,6 +167,8 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin)
   if (plugin == NULL)
     return;
 
+  remove_handlers (plugin);
+
   if (plugin->loop != NULL)
     {
       ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t)
index c81c9215d1e31f84bede406536bfb531d8f1b420..25f7ba6bde6e7e7942c1368c6805ae15f0e911b9 100644 (file)
@@ -125,6 +125,8 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin)
   if (plugin == NULL)
     return;
 
+  remove_handlers (plugin);
+
   if (plugin->loop != NULL)
     {
       ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t)
index 122139eded04114fc46fadb58117b0132180c3f7..adfb71284d70e759575b67f32c9971775ac070bc 100644 (file)
@@ -102,6 +102,8 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin)
   if (plugin == NULL)
     return;
 
+  remove_handlers (plugin);
+
   /* It doesn't ever make sense to keep this plugin on screen
    * after exit
    */
index d80d97f9cd3d6a5633fb5c8a6abf457f15870ef3..8ca3beb033c4b262cd26dd8192e7d035a86daa6c 100644 (file)
@@ -245,6 +245,7 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin)
   if (plugin == NULL)
     return;
 
+  remove_handlers (plugin);
 
   if (plugin->loop != NULL)
     {
index 07460f1b48b9d65f082286fe342d68a61879e1ed..604a7daf0e2e6aa10876b1ab01774804a3fac387 100644 (file)
@@ -126,6 +126,8 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin)
   if (plugin == NULL)
     return;
 
+  remove_handlers (plugin);
+
   if (plugin->loop != NULL)
     {
       ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t)
index bbc5a3b7b0f455461923f8f90851adb57fb7ee81..f58474e094b978328d560e9d3f8bd3f6812dcc98 100644 (file)
@@ -107,6 +107,8 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin)
   if (plugin == NULL)
     return;
 
+  remove_handlers (plugin);
+
   /* It doesn't ever make sense to keep this plugin on screen
    * after exit
    */