Free converted command lines arguments automatically in wxMSW.

This makes the code slightly simpler (no more need for the scope guard) and
avoids memory leaks when not using wxEntry() (but calling wxEntryStart()
instead).

Closes #16664.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78135 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-11-11 01:02:55 +00:00
parent dec924cdf1
commit 69e00f892c

View File

@ -31,7 +31,6 @@
#include "wx/cmdline.h"
#include "wx/dynlib.h"
#include "wx/scopeguard.h"
#include "wx/msw/private.h"
#include "wx/msw/seh.h"
@ -226,7 +225,7 @@ struct wxMSWCommandLineArguments
argv[argc] = NULL;
}
void Free()
~wxMSWCommandLineArguments()
{
if ( !argc )
return;
@ -298,8 +297,6 @@ WXDLLEXPORT int wxEntry(HINSTANCE hInstance,
if ( !wxMSWEntryCommon(hInstance, nCmdShow) )
return -1;
wxON_BLOCK_EXIT_OBJ0(wxArgs, wxMSWCommandLineArguments::Free);
return wxEntry(wxArgs.argc, wxArgs.argv);
}