From 15ce24e448fc226baf7e244dff3f0818357323e7 Mon Sep 17 00:00:00 2001 From: ChrisD Date: Sun, 4 Jun 2017 09:59:54 +0000 Subject: [PATCH] contrib/98_SB_PLAYER.pm: fixed timer cleanup on delete git-svn-id: https://svn.fhem.de/fhem/trunk@14463 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/98_SB_PLAYER.pm | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/fhem/contrib/98_SB_PLAYER.pm b/fhem/contrib/98_SB_PLAYER.pm index fbd7cb135..12c6b3d3b 100644 --- a/fhem/contrib/98_SB_PLAYER.pm +++ b/fhem/contrib/98_SB_PLAYER.pm @@ -62,6 +62,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch'; use constant { true => 1, false => 0 }; sub SB_PLAYER_SonginfoHandleQueue($); # CD 0075 +sub SB_PLAYER_RemoveInternalTimers($); # CD 0078 # the list of favorites # CD 0010 moved to $hash->{helper}{SB_PLAYER_Favs}, fixes problem on module reload @@ -2017,7 +2018,7 @@ sub SB_PLAYER_Undef( $$$ ) { Log3( $hash, 5, "SB_PLAYER_Undef: called" ); - RemoveInternalTimer( $hash ); + SB_PLAYER_RemoveInternalTimers( $hash ); # to be reviewed if that works. # check for uc() @@ -2033,7 +2034,7 @@ sub SB_PLAYER_Undef( $$$ ) { sub SB_PLAYER_Shutdown( $$ ) { my ($hash, $dev) = @_; - RemoveInternalTimer( $hash ); + SB_PLAYER_RemoveInternalTimers( $hash ); Log3( $hash, 5, "SB_PLAYER_Shutdown: called" ); @@ -5064,6 +5065,27 @@ sub SB_PLAYER_tcb_SonginfoHandleQueue($) { } # CD 0072 end +# CD 0078 start +sub SB_PLAYER_RemoveInternalTimers($) { + my ($hash) = @_; + my $name = $hash->{NAME}; + + RemoveInternalTimer( "DelayAmplifier:$name"); + RemoveInternalTimer( "QueryElapsedTime:$name"); + RemoveInternalTimer( "SonginfoHandleQueue:$name"); + RemoveInternalTimer( "StartTalk:$name"); + RemoveInternalTimer( "TTSDelay:$name"); + RemoveInternalTimer( "TTSRestore:$name"); + RemoveInternalTimer( "TTSStartAfterPowerOn:$name"); + RemoveInternalTimer( "TimeoutTTSWaitForPlay:$name"); + RemoveInternalTimer( "TimeoutTTSWaitForPowerOn:$name"); + RemoveInternalTimer( "TriggerPlaylistStop:$name"); + RemoveInternalTimer( "TriggerTTSDone:$name"); + RemoveInternalTimer( "recallPause:$name"); + RemoveInternalTimer( $hash ); +} +# CD 0078 end + # ############################################################################## # No PERL code beyond this line # ##############################################################################