problem deleting derived widgets ...
- From: teratux <teratux gmail com>
- To: "gtkmm-list gnome org" <gtkmm-list gnome org>
- Subject: problem deleting derived widgets ...
- Date: Tue, 26 Aug 2008 16:50:01 -0430
Hi ... I'm trying out an application that I want to create that uses a
glade file to load some widgets. I noticed that when I use several
Dialogs in my application an I load'em all up when my app starts, my
memory usage sort of rises a little. I want to manage my own dialog
creation and destruction rutines. I tried doing a little example to see
if there really is no memory leakage involved in this and stumbled upon
a little problem.
I tried with a basic widget ( no glade involved ):
Gtk::Dialog* dialog = 0;
while (1)
{
dialog = new Gtk::Dialog();
delete dialog;
}
No problem here ....
Tried using a widget loaded from a glade file:
Glib::RefPtr<Gnome::Glade::Xml> refXml;
Gtk::Dialog* dialog = 0;
while (1)
{
refXml = Gnome::Glade::Xml::create("glade.glade", "dialog1");
refXml->get_widget( "dialog1", dialog );
delete dialog;
}
No problem here ...
But, when I use a derived widget ...
Glib::RefPtr<Gnome::Glade::Xml> refXml;
MyDialog* dialog = 0;
while (1)
{
refXml = Gnome::Glade::Xml::create("glade.glade", "dialog1");
refXml->get_widget_derived( "dialog1", dialog );
delete dialog;
}
Leakage all around ... I tried consulting the gtkmm documentation and
there's no say about memory management for derived widgets. Even the
example with libglademm calls it's empty destructor like I do.
Can anyone help me??
Thanks ...
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]