# HG changeset patch # User giacomo # Date 1171296173 28800 # Node ID 7c569af3f65685ccdb83887da5cff451cde0c4ae # Parent a1687bd302cef71b5c7d2136ebe6d23a3db88803 [svn] - aosd: prevent aosd_cleanup from freeing stuff if aosd_init has never been called, closes bug #790 diff -r a1687bd302ce -r 7c569af3f656 ChangeLog --- a/ChangeLog Mon Feb 12 07:20:56 2007 -0800 +++ b/ChangeLog Mon Feb 12 08:02:53 2007 -0800 @@ -1,3 +1,10 @@ +2007-02-12 15:20:56 +0000 Giacomo Lozito + revision [1360] + - aosd: completed volume change trigger, works now + trunk/src/aosd/aosd_trigger.c | 50 +++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 47 insertions(+), 3 deletions(-) + + 2007-02-12 09:39:53 +0000 William Pitcock revision [1358] - update Welsh translation: ~75% completed diff -r a1687bd302ce -r 7c569af3f656 src/aosd/aosd.c --- a/src/aosd/aosd.c Mon Feb 12 07:20:56 2007 -0800 +++ b/src/aosd/aosd.c Mon Feb 12 08:02:53 2007 -0800 @@ -26,6 +26,7 @@ aosd_cfg_t * global_config = NULL; +static gboolean plugin_is_active = FALSE; /* ***************** */ @@ -40,6 +41,7 @@ void aosd_init ( void ) { + plugin_is_active = TRUE; g_log_set_handler( NULL , G_LOG_LEVEL_WARNING , g_log_default_handler , NULL ); global_config = aosd_cfg_new(); @@ -54,16 +56,21 @@ void aosd_cleanup ( void ) { - aosd_trigger_stop( &global_config->osd->trigger ); + if ( plugin_is_active == TRUE ) + { + aosd_trigger_stop( &global_config->osd->trigger ); - aosd_shutdown(); + aosd_shutdown(); - if ( global_config != NULL ) - { - aosd_cfg_delete( global_config ); - global_config = NULL; + if ( global_config != NULL ) + { + aosd_cfg_delete( global_config ); + global_config = NULL; + } + + plugin_is_active = FALSE; } - + return; }