[details] detach from event loop when quitting

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.
This commit is contained in:
Ray Strode 2010-06-30 21:55:59 -04:00
parent 56e6e7d0b9
commit 0e232e2976

View 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);