On Tue, Dec 28, 2010 at 4:11 PM, Simon <[email protected]> wrote:
> Hi there,
>  I was wondering if there was anything anywhere that would call a
> 'delete' on any of the elements that I explicitly 'new' myself?
>
>  I might have been confused by the documentation of ~WApplication and
> WContainerWidget::clear()...
>
> WApplication::~WApplication()
>  - The destructor deletes the root() container, and as a consequence
> the entire widget tree.
>
> WContainerWidget::clear()
>  - This deletes all children that have been added to this container.
>
> I can understand if the use of the word delete in the above
> documentation takes care of deleting private/protected objects, but I
> wonder how safe it is when they start deleting my objects for real...
> like what if I wanted to re-use them after?  or what if the same
> object was added to many containers?
>
> So in all my programming so far, I take great care to keep all
> pointers in protected/private encapsulation, to new them in my
> constructor and delete them in my destructor.  I wonder if I've been
> crashing the fcgid binary or if I've been doing right?
>
> Thanks for clarifying!

Wt does the same Qt does: when parent object is destroyed (for
instance, because it goes out of scope), it deletes all its child
objects. Read this and replace 'Q' with 'W' ;-)

http://doc.qt.nokia.com/latest/objecttrees.html

You only need to explicitly delete objects which are not child of a WObject.

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to