Open GoogleCodeExporter opened 8 years ago
I know another memory leak. This is feature of PHP garbage collector. It works
very
bad with complex objects. To be really sure object will be destructed you must
destroy every internal variable. I'm use
public function destroy(){
parent::destroy();
foreach(get_object_vars($this) as $key => $value){
unset($this->$key);
}
}
just after the disconnect.
To reproduce this kind of the memory leak, code is like:
while(true) {
xmpp1 = new XMPPHP_XMPP(...);
$xmpp1->connect();
$xmpp1->processUntil(array('session_start'));
$xmpp1->presence($status="Cheese!");
//sleep(1);
$xmpp1->disconnect();
// $xmpp1->destroy(); // My destructor of XMPP object
}
Original comment by alexxz2...@gmail.com
on 17 Aug 2009 at 5:03
Fixed in http://github.com/cweiske/xmpphp
Original comment by cwei...@cweiske.de
on 25 Feb 2010 at 6:53
Original issue reported on code.google.com by
ivan.bor...@gmail.com
on 2 Aug 2009 at 8:52