正在显示
2 个修改的文件
包含
12 行增加
和
5 行删除
| @@ -24,9 +24,13 @@ class ImapPool { | @@ -24,9 +24,13 @@ class ImapPool { | ||
| 24 | return static::$pool[$config->getEmail()]; | 24 | return static::$pool[$config->getEmail()]; |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | - | 27 | + /** |
| 28 | + * @param Imap $imap | ||
| 29 | + * @author:dc | ||
| 30 | + * @time 2024/10/14 9:05 | ||
| 31 | + */ | ||
| 28 | public static function release(Imap $imap){ | 32 | public static function release(Imap $imap){ |
| 29 | - | 33 | + unset(static::$pool[$imap->config->getEmail()]); |
| 30 | } | 34 | } |
| 31 | 35 | ||
| 32 | 36 |
| @@ -440,9 +440,12 @@ class SyncMail { | @@ -440,9 +440,12 @@ class SyncMail { | ||
| 440 | 440 | ||
| 441 | 441 | ||
| 442 | 442 | ||
| 443 | - | ||
| 444 | - | ||
| 445 | - | 443 | + public function __destruct() |
| 444 | + { | ||
| 445 | + // TODO: Implement __destruct() method. | ||
| 446 | + ImapPool::release($this->imap); | ||
| 447 | + unset($this->imap); | ||
| 448 | + } | ||
| 446 | 449 | ||
| 447 | 450 | ||
| 448 | } | 451 | } |
-
请 注册 或 登录 后发表评论