Hey Koen,

sorry, my bad. Of course they will end up on the heap, they're part of a 
heap-allocated WApplication. What I was trying to say is that I'm trying 
to keep the amount of allocations as small as possible by instantiating 
them by value as data members of classes.

Cheers,

Rutger





On 2013-06-13 14:42, Koen Deforche wrote:
> Hey Rutger,
>
> Since Wt does not tie threads to sessions (that wouldn't scale), it
> cannot keep stacks alive in between requests, and thus there is no
> practical way to use stack-allocated widgets in Wt (except for, as
> Dmitriy suggested, when you do block the stack with e.g. WDialog::exec()
> in a recursive eventloop, but this is not recommended since it breaks
> your application scalability).
>
> How would you envision to keep widgets allocated on the stack?
>
> Regards,
> koen
>
>
> 2013/6/13 Rutger ter Borg
> <rut...@terborg.net <mailto:rut...@terborg.net>>
>
>
>     On 2013-06-13 13:04, Dmitriy Igrishin wrote:
>      >
>      > While it's possible, it seems to me, that this coding technique
>     is just
>      > asking for troubles. Wt has a pointer semantics and heavily
>     oriented to
>      > the abstract classes design. There are a lot of allocations under
>     the hood
>      > of Wt, so I don't believe in a benefit of stack-allocated objects
>     (except of
>      > WDialog and similar instances in case of blocking the thread
>     awaitng for the
>      > user response).
>      >
>
>
>     Well, it saves typing :-). More seriously though, I prefer to going
>     trough some trouble now and ending up with a full understanding over not
>     worrying and hoping for the best.
>
>
>      >
>      > Yes, because WMenuItem is owns contents. WMenuItem needs to be
>      > an owner of contents while the content's ownership may be
>     transferred to
>      > the contents stack after the actual loading.
>      > On the other hand, the content that was not reowned must be deleted
>      > by the WMenuItem.
>
>     The issue was solved by making the content widgets heap allocated and
>     marking their ownership as transferred.
>
>     Cheers,
>
>     Rutger
>
>
>
>
>     
> ------------------------------------------------------------------------------
>     This SF.net email is sponsored by Windows:
>
>     Build for Windows Store.
>
>     http://p.sf.net/sfu/windows-dev2dev
>     _______________________________________________
>     witty-interest mailing list
>     witty-interest@lists.sourceforge.net
>     <mailto:witty-interest@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
>
>
>
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>



------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to