Re: [gtkmm] Memory Leak?



Hello César!

=?iso-8859-1?Q?César?= =?iso-8859-1?Q?_González?= wrote:
I think I'm forgetting something, because the memory leak is huge.

void HelloWorld::on_button_clicked()
{
   while (1)
   {
      m_button.hide();
      m_button.show();
   }
}


I think it would be wise to give GTK a chance to process its event queue, i.e.:

while (1) {
    m_button.hide();
    m_button.show();
    while (Gtk::Main::events_pending()) {
        Gtk::Main::iteration();
    }
}

--
Christer




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]