From 7373da1528070b74027119696fe8ddacc5d8aa0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ed=C3=AAnis=20Freindorfer=20Azevedo?= Date: Wed, 6 Mar 2019 22:43:32 -0300 Subject: [PATCH] Fix segmentation fault issue when using WX port command line on Linux and MacOS. --- src/wx/wxvbam.cpp | 3 ++- src/wx/wxvbam.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wx/wxvbam.cpp b/src/wx/wxvbam.cpp index 3731f9c8..b28b5807 100644 --- a/src/wx/wxvbam.cpp +++ b/src/wx/wxvbam.cpp @@ -590,7 +590,8 @@ bool wxvbamApp::OnCmdLineParsed(wxCmdLineParser& cl) } wxvbamApp::~wxvbamApp() { - free(home); + if (home != NULL) + free(home); } MainFrame::MainFrame() diff --git a/src/wx/wxvbam.h b/src/wx/wxvbam.h index fbefca0d..4ab2a013 100644 --- a/src/wx/wxvbam.h +++ b/src/wx/wxvbam.h @@ -142,7 +142,7 @@ protected: private: wxPathList config_path; - char* home; + char* home = NULL; }; DECLARE_APP(wxvbamApp);