Skip to content

Commit

Permalink
fix: close internal tokenizer stream (#16)
Browse files Browse the repository at this point in the history
The object is cleaned up by PHP but the (temp) stream remains open thus
leaking a lot of memory. Potentially thousands of tokenizer instances
are created when syncing large mailboxes which causes significant memory
leaks.

Signed-off-by: Richard Steinmetz <[email protected]>
  • Loading branch information
st3iny authored Nov 6, 2024
1 parent 406b4d1 commit e72ae63
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Horde/Imap/Client/Tokenize.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public function __construct($data = null)
}
}

public function __destruct() {
$this->_stream->close();
}

/**
*/
public function __clone()
Expand Down

0 comments on commit e72ae63

Please sign in to comment.