Fix bug with using uninitialized flags in GetParentForModalDialog().

GetParentForModalDialog() was called from the ctor initialized list before
m_windowStyle could be initialized by the base class ctor in several different
places, meaning that the check for wxDIALOG_NO_PARENT in this function was
using uninitialized variable.

Fix this by passing the style parameter explicitly to this function to allow
using it from derived class ctors. Still keep an overload which uses the
actual window parent and flags which is simpler to use for later calls to this
function.

Thanks valgrind for finding this one.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-04-18 00:05:37 +00:00
parent 852febd80e
commit cdc48273b4
24 changed files with 49 additions and 42 deletions

View File

@@ -44,10 +44,13 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent,
const wxString& caption,
long style,
const wxPoint& WXUNUSED(pos))
: wxMessageDialogWithCustomLabels(GetParentForModalDialog(parent),
message,
caption,
style)
: wxMessageDialogWithCustomLabels
(
GetParentForModalDialog(parent, style),
message,
caption,
style
)
{
}