Hi Joseph,

> Is WContainerWidget::clear() always called when a WContainerWidget is
> deleted?
>

Yes, it is.

When do I need to delete widgets that I allocated?
>

As longs as your allocated widgets have parents, the answer is that you
never have to delete those widgets yourselft. It's up to a parent widget to
delete it's children.


Regards,
Dushan

2010/4/5 Joseph VanAndel <[email protected]>

> If I allocate memory for a widget, and then add a widget to a
> WContainerWidget who is responsible for deleting the widget?
>
> When I look at WContainerWidget.C, I see the following function:
>
> void WContainerWidget::clear()
> {
>  // first delete the widgets, this will also remove them from
>  // the layout
>  while (!children().empty()) {
>    WWidget *w = children().back();
>    //removeWidget(w);
>    delete w;
>  }
>
> #ifndef WT_NO_LAYOUT
>  delete layout_;
>  layout_ = 0;
> #endif // WT_NO_LAYOUT
> }
> =================================
> Is WContainerWidget::clear() always called when a WContainerWidget is
> deleted?
>
> When do I need to delete widgets that I allocated?
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to