mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-07 13:08:07 +02:00
Remove event handlers on destroy in plugins
This is because we can end up in scenarios where a plugin gets destroyed, and readded without getting hidden in between.
This commit is contained in:
parent
2b0d185546
commit
546fbdc0b8
7 changed files with 23 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -245,6 +245,7 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin)
|
|||
if (plugin == NULL)
|
||||
return;
|
||||
|
||||
remove_handlers (plugin);
|
||||
|
||||
if (plugin->loop != NULL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue