This is basic C++.
Once you allocate something on the heap using new in some part of the code
you will have to delete it.
Wt gurentees that it mangaes all memory, and deletes the widgets at the end
of the session.
I suggest you to read about
RAII<http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization>and
take a close look at smart pointers, especially boost's shared_ptr.
Think about it, if you allocate some object without deleteing it (some
non-related Wt object for example) there is no reason it won't cause a
memory leak.
If you are on linux I also suggest you to use valgrind to inspect such
things, it will prove you that there is no memory leak in the code.

2010/3/8 <[email protected]>

>
> Hey, omer
>
> So, if no Wt, It will cause memory leak, yes?
>
> If I want to my class can do this kind of function call, what
> can I do?
>
> > This will not cause any memory leak because Wt handles all memory.
> > 2010/3/8  <*[email protected]* <[email protected]>
> >
> > Hi,
>
> > I see this kind of function call in the mailing list and
> > the documentation of Wt.
>
> > But I'm really not sure about this function call:
>
> >    > addWidget(new WText("this is page2"));
>
> > Does it will cause memory leak or not?
>
> > I'm really not sure, so want to get an answer.
>
>
> ------------------------------------------------------------------------------
> 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