mirror of
https://github.com/danog/MadelineProto.git
synced 2025-01-23 10:31:13 +01:00
Add onStop method into __destruct()
This commit is contained in:
parent
1ca83568cf
commit
2310da7d39
@ -149,9 +149,6 @@ abstract class EventHandler extends AbstractAPI
|
||||
$r = $r->await();
|
||||
}
|
||||
}
|
||||
if (\method_exists($this, 'onStop')) {
|
||||
Shutdown::addCallback([$this, 'onStop']);
|
||||
}
|
||||
if ($main) {
|
||||
$this->setReportPeers($this->getReportPeers());
|
||||
}
|
||||
@ -480,4 +477,10 @@ abstract class EventHandler extends AbstractAPI
|
||||
|
||||
return $plugins;
|
||||
}
|
||||
public function __destruct()
|
||||
{
|
||||
if (\method_exists($this, 'onStop')) {
|
||||
$this->onStop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user