]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[details] detach from event loop when quitting
authorRay Strode <rstrode@redhat.com>
Thu, 1 Jul 2010 01:55:59 +0000 (21:55 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 1 Jul 2010 01:55:59 +0000 (21:55 -0400)
If the user has the details plugin configured, and the
system does plymouth quit --retain-splash, then their
may be a crash.

This is because the plugin event loop exit handler will called
after the plugin is destroyed.  This commit makes sure
the exit handler is removed before the plugin is freed.

src/plugins/splash/details/plugin.c

index fd8d2b8e55df42776d2856bdbc49a5dd6fd37ba0..763e128fab1898d486430bce69e926ebfd7f4778 100644 (file)
@@ -67,6 +67,8 @@ typedef struct
 } view_t;
 
 ply_boot_splash_plugin_interface_t *ply_boot_splash_plugin_get_interface (void);
+static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin);
+
 struct _ply_boot_splash_plugin
 {
   ply_event_loop_t *loop;
@@ -141,6 +143,14 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin)
   if (plugin == NULL)
     return;
 
+  if (plugin->loop != NULL)
+    {
+      ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t)
+                                             detach_from_event_loop,
+                                             plugin);
+      detach_from_event_loop (plugin);
+    }
+
   free_views (plugin);
 
   free (plugin);