From 69e00f892c47e7fd338915e6dbde2e3c30768653 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 11 Nov 2014 01:02:55 +0000 Subject: [PATCH] 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 --- src/msw/main.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/msw/main.cpp b/src/msw/main.cpp index e45ca2a958..ad0616bef4 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -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); }