Destroy the wxDialog::ShowWindowModalThenDo() functor a.s.a.p.
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 1 Oct 2013 12:19:56 +0000 (12:19 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 1 Oct 2013 12:19:56 +0000 (12:19 +0000)
commit5ca59eb82e38957650bb4423030aa446c354cfe3
treebc4106075bcfefd207b79c95b3e16d9b06a8c7ef
parent38ececd4c399ade4c47ca424eb72dbbd5dda528e
Destroy the wxDialog::ShowWindowModalThenDo() functor a.s.a.p.

Previously, the functor was kept in a helper event handler that was bound to
wxEVT_WINDOW_MODAL_DIALOG_CLOSED and only marked as already called, but never
unbound. Consequently, the functor object remained allocated for as long as the
event table existed and was only freed with the dialog instance.

Change the logic to destroy the functor object as soon as it was called and is
no longer needed for anything.

This is particularly important when used with C++11 lambdas that capture the
dialog in a wxWindowPtr pointer, because the pointer would be retained forever
otherwise.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74890 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/dialog.h