From f80684387a0371d69df155d9d2bde058371c5aa2 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 10 Aug 2015 10:11:32 -0400 Subject: [PATCH] boot-splash: don't crash in free if module not loaded ply_boot_splash_free currently calls some code that depends on a module being loaded. We call ply_boot_splash_free to clean up the boot splash object if a module can't be loaded, leading to crash. This commit addresses that issue by only calling the module specific destruction code in ply_boot_splash_free in the case where a module is loaded. https://bugs.freedesktop.org/show_bug.cgi?id=91590 --- src/libply-splash-core/ply-boot-splash.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/libply-splash-core/ply-boot-splash.c b/src/libply-splash-core/ply-boot-splash.c index e853e1f5..87a7a0c3 100644 --- a/src/libply-splash-core/ply-boot-splash.c +++ b/src/libply-splash-core/ply-boot-splash.c @@ -401,16 +401,17 @@ ply_boot_splash_free (ply_boot_splash_t *splash) splash); } - ply_boot_splash_unset_keyboard (splash); + if (splash->module_handle != NULL) { + ply_boot_splash_unset_keyboard (splash); - remove_pixel_displays (splash); - ply_list_free (splash->pixel_displays); + remove_pixel_displays (splash); + ply_list_free (splash->pixel_displays); - remove_text_displays (splash); - ply_list_free (splash->text_displays); + remove_text_displays (splash); + ply_list_free (splash->text_displays); - if (splash->module_handle != NULL) ply_boot_splash_unload (splash); + } if (splash->idle_trigger != NULL) ply_trigger_free (splash->idle_trigger);