Memory issues
| From: | Nghia | Date: | Mon, 13 Dec 2004 01:08:34 +0000 |
| Subject: | Memory issues | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-5342@lists.php.net to get a copy of this message | ||
Hi,
Does anyone know how memory allocation/deallocation work with PHP-GTK? It
seems that the memory usuage just keeps increasing even when I'm sure I've
freed up memory via destroy() on the widgets. This happens on a Windows
98/XP machine.
Heres a really simple example
<?php
if (!extension_loaded('gtk'))
dl( 'php_gtk.' . PHP_SHLIB_SUFFIX);
function button_press()
{
$dialog = &new GtkDialog();
$dialog->show_all();
$dialog->destroy();
}
$window = &new GtkWindow();
$button = &new GtkButton("Dialog");
$button->connect('clicked', 'button_press');
$window->add($button);
$window->show_all();
Gtk::main();
?>
Just keep clicking the button and the memory will start to increase rather
than remain constant as I would expect.
Nghia