Re: Good style for memory management?
- From: Paul Pogonyshev <pogonyshev gmx net>
- To: gtkmm-list gnome org
- Subject: Re: Good style for memory management?
- Date: Sun, 18 Mar 2007 18:25:06 +0200
I wrote:
> Roland Schwarz wrote:
> > Paul Pogonyshev wrote:
> > > When I used gtkmm, I tended to let GTK+ manage all widgets itself, i.e.
> > > by calling manage() on them. This way, widgets in destroyed containers
> > > are normally destroyed as well and you don't need to keep references to
> > > them. You only need to delete windows.
> >
> > Ok, fine. But how to you handle the time between new'ing the widgets and
> > adding them to their container? If I understand the memory management
> > correctly the widgets are effectively unmanaged until they have been
> > added to the container. I.e. if something throws before they have been
> > added to the container, none will clean up (manage) them. Not?
>
> Gtk::VBox* vbox = manage (new Gtk::VBox (...));
>
> Something like that. Nothing can throw in between. In any case, you can
> not care about memory leaks if something throws when you build your GUI.
> Because then you have more important problems at hands, right?
Ah, I misread. In between of manage() and adding there can be throws, right,
but my second statement should still apply.
Paul
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]