cleaning up nav dialogs properly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46135 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -77,7 +77,7 @@ wxDirDialog::wxDirDialog(wxWindow *parent,
|
||||
|
||||
int wxDirDialog::ShowModal()
|
||||
{
|
||||
NavDialogRef dialog;
|
||||
NavDialogRef dialog = NULL;
|
||||
NavDialogCreationOptions options;
|
||||
NavReplyRecord reply ;
|
||||
bool disposeReply = false ;
|
||||
@@ -134,6 +134,9 @@ int wxDirDialog::ShowModal()
|
||||
// apparently cancelling shouldn't change m_path
|
||||
if ( err != noErr && err != userCanceledErr )
|
||||
m_path = wxEmptyString ;
|
||||
|
||||
if ( dialog )
|
||||
::NavDialogDispose(dialog);
|
||||
|
||||
return (err == noErr) ? wxID_OK : wxID_CANCEL ;
|
||||
}
|
||||
|
@@ -380,7 +380,10 @@ int wxFileDialog::ShowModal()
|
||||
::DisposeNavObjectFilterUPP(navFilterUPP);
|
||||
|
||||
if (err != noErr)
|
||||
{
|
||||
::NavDialogDispose(dialog);
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
||||
NavReplyRecord navReply;
|
||||
err = ::NavDialogGetReply(dialog, &navReply);
|
||||
@@ -411,6 +414,7 @@ int wxFileDialog::ShowModal()
|
||||
if (!thePath)
|
||||
{
|
||||
::NavDisposeReply(&navReply);
|
||||
::NavDialogDispose(dialog);
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
||||
@@ -427,6 +431,7 @@ int wxFileDialog::ShowModal()
|
||||
}
|
||||
|
||||
::NavDisposeReply(&navReply);
|
||||
::NavDialogDispose(dialog);
|
||||
|
||||
return (err == noErr) ? wxID_OK : wxID_CANCEL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user