>> The problem is, when WPushButton is pushed and I try to remove the single 
>> menu
>> entry, the program dies. I guess this doesn't surprise me, because the
>> WPushButton is a child widget of the single menu item. So, during the 
>> callback,
>> I am removing the parent of the widget which has the callback. Is there a way
>> around this? The workaround I am now using is just to hide the first menu 
>> entry.
>
> That really should work though. A signal can handle being deleted
> while it is emitted, and Wt's widgets also are aware that they may be
> deleted when emitting a signal.

I was using Wt 3.1.3. I just upgraded to 3.1.5 (sorry, I didn't know
I'd fallen so far behind). I retried the test case (with only the
upgrade, not the additional patch in the git repo), and my program now
works.

At this point, I think I'm going to redesign my program. I also need
to install wthttp because debugging has been difficult (I've only been
using fcgi).

Thanks for developing Wt. I see a lot of exciting applications for it.

-Dave

>
> I tried your test case and could not reproduce the bug. I did however
> that the destructor of WMenuItem did not properly clean up memory
> (fixed in latest git, or with the following patch):
>
> diff --git a/src/Wt/WMenuItem.C b/src/Wt/WMenuItem.C
> index 0d2bb09..6f9b2e5 100644
> --- a/src/Wt/WMenuItem.C
> +++ b/src/Wt/WMenuItem.C
> @@ -57,6 +57,9 @@ WMenuItem::~WMenuItem()
>  {
>   if (menu_)
>     menu_->removeItem(this);
> +
> +  delete itemWidget_;
> +  delete contents();
>  }
>
> In attachment your code converted to a test case. As you can see, I
> simplified the code (although the original ran fine too): simply
> deleting the item will do what you want it to do (including deleteing
> all the associated contents of the chooseDBContainer_).
>
> If you are running on Linux, can you show the output of valgrind of your 
> crash ?
>
> Regards
> koen

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to