diff --git a/src/Client.php b/src/Client.php index b6a2803..6447227 100644 --- a/src/Client.php +++ b/src/Client.php @@ -145,7 +145,7 @@ class Client while (static::isSessionLoggedIn($instance)) { try { $instance->loop(); - warning('Update loop stopped: ' . $instance->session); + warning('Update loop stopped: ' . Files::getSessionName($instance->session)); } catch (\Throwable $e) { error('Error in Madeline Loop.', Logger::getExceptionAsArray($e)); Client::getInstance()->removeBrokenSessions(); diff --git a/src/EventObservers/EventHandler.php b/src/EventObservers/EventHandler.php index 1fa52bd..87931cb 100644 --- a/src/EventObservers/EventHandler.php +++ b/src/EventObservers/EventHandler.php @@ -31,6 +31,7 @@ class EventHandler extends \danog\MadelineProto\EventHandler if (empty(static::$instances[$this->sessionName])) { warning("Sending stop signal: {$this->sessionName}"); $this->stop(); + $this->unsetEventHandler(); $this->setNoop(); return; }