removed unregister calls from plugin unload methods
This commit is contained in:
		| @@ -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); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
| @@ -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); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
| @@ -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); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
| @@ -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); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
| @@ -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); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
| @@ -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); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
| @@ -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); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
| @@ -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); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
| @@ -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); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
| @@ -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); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
| @@ -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); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
		Reference in New Issue
	
	Block a user