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:
Stefan Csomor
2007-05-21 07:10:06 +00:00
parent 67e7088d06
commit 988c502299
2 changed files with 9 additions and 1 deletions

View File

@@ -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 ;
}

View File

@@ -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;
}