From 3f1339129c58920a9faa046c1600c870b0484acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Sat, 3 May 2014 23:09:38 +0200 Subject: [PATCH] removed unregister calls from plugin unload methods --- application/plugins/Dedimania/Dedimania.php | 4 ---- application/plugins/MCTeam/ChatMessagePlugin.php | 8 ++------ application/plugins/MCTeam/CustomVotesPlugin.php | 10 ++-------- application/plugins/MCTeam/DonationPlugin.php | 7 +------ application/plugins/MCTeam/KarmaPlugin.php | 3 --- application/plugins/MCTeam/LocalRecordsPlugin.php | 2 -- application/plugins/MCTeam/ServerRankingPlugin.php | 4 +--- application/plugins/MCTeam/WidgetPlugin.php | 3 --- application/plugins/steeffeen/ChatlogPlugin.php | 2 -- application/plugins/steeffeen/EndurancePlugin.php | 3 --- application/plugins/steeffeen/ObstaclePlugin.php | 3 --- 11 files changed, 6 insertions(+), 43 deletions(-) diff --git a/application/plugins/Dedimania/Dedimania.php b/application/plugins/Dedimania/Dedimania.php index 2daff164..26880947 100644 --- a/application/plugins/Dedimania/Dedimania.php +++ b/application/plugins/Dedimania/Dedimania.php @@ -287,7 +287,6 @@ class Dedimania implements CallbackListener, CommandListener, TimerListener, Plu $this->fetchDedimaniaRecords(true); } - /** * Handle EndMap callback * @@ -1144,9 +1143,6 @@ class Dedimania implements CallbackListener, CommandListener, TimerListener, Plu * Unload the plugin and its resources */ public function unload() { - $this->maniaControl->timerManager->unregisterTimerListenings($this); - $this->maniaControl->callbackManager->unregisterCallbackListener($this); - unset($this->maniaControl); } /** diff --git a/application/plugins/MCTeam/ChatMessagePlugin.php b/application/plugins/MCTeam/ChatMessagePlugin.php index 99f084f5..70c80e89 100644 --- a/application/plugins/MCTeam/ChatMessagePlugin.php +++ b/application/plugins/MCTeam/ChatMessagePlugin.php @@ -26,11 +26,9 @@ class ChatMessagePlugin implements CommandListener, Plugin { const SETTING_AFK_FORCE_SPEC = 'AFK command forces spec'; /** - * Private properties - */ - /** - * @var maniaControl $maniaControl + * Private Properties */ + /** @var maniaControl $maniaControl */ private $maniaControl = null; /** @@ -124,8 +122,6 @@ class ChatMessagePlugin implements CommandListener, Plugin { * Unload the plugin and its resources */ public function unload() { - $this->maniaControl->commandManager->unregisterCommandListener($this); - unset($this->maniaControl); } /** diff --git a/application/plugins/MCTeam/CustomVotesPlugin.php b/application/plugins/MCTeam/CustomVotesPlugin.php index 8d48c789..eacf0127 100644 --- a/application/plugins/MCTeam/CustomVotesPlugin.php +++ b/application/plugins/MCTeam/CustomVotesPlugin.php @@ -74,7 +74,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP const CB_CUSTOM_VOTE_FINISHED = 'CustomVotesPlugin.CustomVoteFinished'; /** - * Private properties + * Private Properties */ /** @var maniaControl $maniaControl */ private $maniaControl = null; @@ -191,13 +191,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP $this->maniaControl->client->setCallVoteRatiosEx(false, $ratioArray); $this->destroyVote(); - $emptyManialink = new ManiaLink(self::MLID_ICON); - $this->maniaControl->manialinkManager->sendManialink($emptyManialink); - $this->maniaControl->commandManager->unregisterCommandListener($this); - $this->maniaControl->callbackManager->unregisterCallbackListener($this); - $this->maniaControl->manialinkManager->unregisterManialinkPageAnswerListener($this); - $this->maniaControl->timerManager->unregisterTimerListenings($this); - unset($this->maniaControl); + $this->maniaControl->manialinkManager->hideManialink(self::MLID_ICON); } /** diff --git a/application/plugins/MCTeam/DonationPlugin.php b/application/plugins/MCTeam/DonationPlugin.php index 4fe543a8..457b678d 100644 --- a/application/plugins/MCTeam/DonationPlugin.php +++ b/application/plugins/MCTeam/DonationPlugin.php @@ -109,12 +109,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin { * @see \ManiaControl\Plugins\Plugin::unload() */ public function unload() { - $emptyManialink = new ManiaLink(self::MLID_DONATE_WIDGET); - $this->maniaControl->manialinkManager->sendManialink($emptyManialink); - - $this->maniaControl->callbackManager->unregisterCallbackListener($this); - $this->maniaControl->commandManager->unregisterCommandListener($this); - unset($this->maniaControl); + $this->maniaControl->manialinkManager->hideManialink(self::MLID_DONATE_WIDGET); } /** diff --git a/application/plugins/MCTeam/KarmaPlugin.php b/application/plugins/MCTeam/KarmaPlugin.php index 188e09c6..280c4398 100644 --- a/application/plugins/MCTeam/KarmaPlugin.php +++ b/application/plugins/MCTeam/KarmaPlugin.php @@ -384,9 +384,6 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin { */ public function unload() { $this->maniaControl->manialinkManager->hideManialink(self::MLID_KARMA); - $this->maniaControl->callbackManager->unregisterCallbackListener($this); - $this->maniaControl->timerManager->unregisterTimerListenings($this); - unset($this->maniaControl); } /** diff --git a/application/plugins/MCTeam/LocalRecordsPlugin.php b/application/plugins/MCTeam/LocalRecordsPlugin.php index 7d01322c..d3b8e730 100644 --- a/application/plugins/MCTeam/LocalRecordsPlugin.php +++ b/application/plugins/MCTeam/LocalRecordsPlugin.php @@ -116,8 +116,6 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList * @see \ManiaControl\Plugins\Plugin::unload() */ public function unload() { - $this->maniaControl->callbackManager->unregisterCallbackListener($this); - $this->maniaControl->timerManager->unregisterTimerListenings($this); } /** diff --git a/application/plugins/MCTeam/ServerRankingPlugin.php b/application/plugins/MCTeam/ServerRankingPlugin.php index ad30c0cc..bff9a255 100644 --- a/application/plugins/MCTeam/ServerRankingPlugin.php +++ b/application/plugins/MCTeam/ServerRankingPlugin.php @@ -112,11 +112,9 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener { } /** - * Unload the plugin and its resources + * @see \ManiaControl\Plugins\Plugin::unload() */ public function unload() { - $this->maniaControl->callbackManager->unregisterCallbackListener($this); - $this->maniaControl->commandManager->unregisterCommandListener($this); } /** diff --git a/application/plugins/MCTeam/WidgetPlugin.php b/application/plugins/MCTeam/WidgetPlugin.php index 79187138..9db5f5a6 100644 --- a/application/plugins/MCTeam/WidgetPlugin.php +++ b/application/plugins/MCTeam/WidgetPlugin.php @@ -423,9 +423,6 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { $this->closeWidget(self::MLID_SERVERINFOWIDGET); $this->closeWidget(self::MLID_MAPWIDGET); $this->closeWidget(self::MLID_NEXTMAPWIDGET); - $this->maniaControl->callbackManager->unregisterCallbackListener($this); - $this->maniaControl->timerManager->unregisterTimerListenings($this); - unset($this->maniaControl); } /** diff --git a/application/plugins/steeffeen/ChatlogPlugin.php b/application/plugins/steeffeen/ChatlogPlugin.php index 599a9d63..91d85e3e 100644 --- a/application/plugins/steeffeen/ChatlogPlugin.php +++ b/application/plugins/steeffeen/ChatlogPlugin.php @@ -91,8 +91,6 @@ class ChatlogPlugin implements CallbackListener, Plugin { * @see \ManiaControl\Plugins\Plugin::unload() */ public function unload() { - $this->maniaControl->callbackManager->unregisterCallbackListener($this); - unset($this->maniaControl); } /** diff --git a/application/plugins/steeffeen/EndurancePlugin.php b/application/plugins/steeffeen/EndurancePlugin.php index 5e342a43..e18eab18 100644 --- a/application/plugins/steeffeen/EndurancePlugin.php +++ b/application/plugins/steeffeen/EndurancePlugin.php @@ -62,9 +62,6 @@ class EndurancePlugin implements CallbackListener, Plugin { * @see \ManiaControl\Plugins\Plugin::unload() */ public function unload() { - $this->maniaControl->callbackManager->unregisterCallbackListener($this); - $this->maniaControl->callbackManager->unregisterScriptCallbackListener($this); - unset($this->maniaControl); } /** diff --git a/application/plugins/steeffeen/ObstaclePlugin.php b/application/plugins/steeffeen/ObstaclePlugin.php index f78f3390..d37d63ce 100644 --- a/application/plugins/steeffeen/ObstaclePlugin.php +++ b/application/plugins/steeffeen/ObstaclePlugin.php @@ -70,9 +70,6 @@ class ObstaclePlugin implements CallbackListener, CommandListener, Plugin { * @see \ManiaControl\Plugins\Plugin::unload() */ public function unload() { - $this->maniaControl->commandManager->unregisterCommandListener($this); - $this->maniaControl->callbackManager->unregisterScriptCallbackListener($this); - unset($this->maniaControl); } /**