From 2ffa4b47c475d07860356040d1d57a72f0d74ba5 Mon Sep 17 00:00:00 2001 From: kremsy Date: Sat, 1 Feb 2014 14:50:24 +0100 Subject: [PATCH] plugins unregistering from timerlistener --- application/plugins/CustomVotes.php | 1 + application/plugins/Karma.php | 1 + application/plugins/LocalRecords.php | 1 + application/plugins/QueuePlugin.php | 3 ++- application/plugins/SlotMachine.php | 1 + application/plugins/TeamSpeakPlugin.php | 1 + application/plugins/WidgetPlugin.php | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) diff --git a/application/plugins/CustomVotes.php b/application/plugins/CustomVotes.php index af085882..8dc56b0f 100644 --- a/application/plugins/CustomVotes.php +++ b/application/plugins/CustomVotes.php @@ -191,6 +191,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP $this->maniaControl->commandManager->unregisterCommandListener($this); $this->maniaControl->callbackManager->unregisterCallbackListener($this); $this->maniaControl->manialinkManager->unregisterManialinkPageAnswerListener($this); + $this->maniaControl->timerManager->unregisterTimerListenings($this); unset($this->maniaControl); } diff --git a/application/plugins/Karma.php b/application/plugins/Karma.php index 82e5e8ef..8ba3f7ba 100644 --- a/application/plugins/Karma.php +++ b/application/plugins/Karma.php @@ -99,6 +99,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin { $manialinkText = $emptyManialink->render()->saveXML(); $this->maniaControl->manialinkManager->sendManialink($manialinkText); $this->maniaControl->callbackManager->unregisterCallbackListener($this); + $this->maniaControl->timerManager->unregisterTimerListenings($this); unset($this->maniaControl); } diff --git a/application/plugins/LocalRecords.php b/application/plugins/LocalRecords.php index 73ac84c0..3ab69f4d 100644 --- a/application/plugins/LocalRecords.php +++ b/application/plugins/LocalRecords.php @@ -92,6 +92,7 @@ class LocalRecordsPlugin implements CallbackListener, TimerListener, Plugin { */ public function unload() { $this->maniaControl->callbackManager->unregisterCallbackListener($this); + $this->maniaControl->timerManager->unregisterTimerListenings($this); unset($this->maniaControl); } diff --git a/application/plugins/QueuePlugin.php b/application/plugins/QueuePlugin.php index f3f23f05..92672403 100644 --- a/application/plugins/QueuePlugin.php +++ b/application/plugins/QueuePlugin.php @@ -88,6 +88,7 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns public function unload() { $this->maniaControl->manialinkManager->unregisterManialinkPageAnswerListener($this); $this->maniaControl->callbackManager->unregisterCallbackListener($this); + $this->maniaControl->timerManager->unregisterTimerListenings($this); foreach($this->spectators as $spectator) { $this->maniaControl->client->forceSpectator($spectator, 3); @@ -101,7 +102,7 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns $this->queue = array(); $this->spectators = array(); $this->showPlay = array(); - $this->maniaControl = null; + unset($this->maniaControl); } /** diff --git a/application/plugins/SlotMachine.php b/application/plugins/SlotMachine.php index e6619c1b..319b471c 100644 --- a/application/plugins/SlotMachine.php +++ b/application/plugins/SlotMachine.php @@ -768,6 +768,7 @@ class SlotMachinePlugin implements Plugin, CallbackListener, ManialinkPageAnswer $this->maniaControl->callbackManager->unregisterCallbackListener($this); $this->maniaControl->manialinkManager->unregisterManialinkPageAnswerListener($this); + $this->maniaControl->timerManager->unregisterTimerListenings($this); unset($this->maniaControl); } diff --git a/application/plugins/TeamSpeakPlugin.php b/application/plugins/TeamSpeakPlugin.php index 958cb503..61331c07 100644 --- a/application/plugins/TeamSpeakPlugin.php +++ b/application/plugins/TeamSpeakPlugin.php @@ -135,6 +135,7 @@ class TeamSpeakPlugin implements CallbackListener, CommandListener, ManialinkPag $this->maniaControl->manialinkManager->unregisterManialinkPageAnswerListener($this); $this->maniaControl->callbackManager->unregisterCallbackListener($this); $this->maniaControl->commandManager->unregisterCommandListener($this); + $this->maniaControl->timerManager->unregisterTimerListenings($this); unset($this->maniaControl); } diff --git a/application/plugins/WidgetPlugin.php b/application/plugins/WidgetPlugin.php index 0397c870..ae84f7ae 100644 --- a/application/plugins/WidgetPlugin.php +++ b/application/plugins/WidgetPlugin.php @@ -139,6 +139,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { $this->closeWidget(self::MLID_MAPWIDGET); $this->closeWidget(self::MLID_NEXTMAPWIDGET); $this->maniaControl->callbackManager->unregisterCallbackListener($this); + $this->maniaControl->timerManager->unregisterTimerListenings($this); unset($this->maniaControl); }