From cf06709cb4cc2e2f00228a06f44b6a69588df2bd Mon Sep 17 00:00:00 2001 From: vsonnier Date: Thu, 7 Jun 2018 21:44:17 +0200 Subject: [PATCH] Fix memory leak of the previous commit --- src/BookmarkMgr.cpp | 2 ++ src/demod/DemodulatorMgr.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/BookmarkMgr.cpp b/src/BookmarkMgr.cpp index e8ff07b..661b9dd 100644 --- a/src/BookmarkMgr.cpp +++ b/src/BookmarkMgr.cpp @@ -584,6 +584,7 @@ std::wstring BookmarkMgr::getSafeWstringValue(DataNode* node, const std::string& } catch (DataTypeMismatchException* e) { //2) wstring decode fail, try simple std::string + delete e; std::string decodedStdString; try { @@ -594,6 +595,7 @@ std::wstring BookmarkMgr::getSafeWstringValue(DataNode* node, const std::string& } catch (DataTypeMismatchException* e) { //nothing works, return an empty string. + delete e; decodedWString = L""; } } diff --git a/src/demod/DemodulatorMgr.cpp b/src/demod/DemodulatorMgr.cpp index cc3fa27..80d2d9b 100644 --- a/src/demod/DemodulatorMgr.cpp +++ b/src/demod/DemodulatorMgr.cpp @@ -445,6 +445,7 @@ std::wstring DemodulatorMgr::getSafeWstringValue(DataNode* node) { } catch (DataTypeMismatchException* e) { //2) wstring decode fail, try simple std::string + delete e; std::string decodedStdString; try { @@ -454,6 +455,7 @@ std::wstring DemodulatorMgr::getSafeWstringValue(DataNode* node) { decodedWString = wxString(decodedStdString).ToStdWstring(); } catch (DataTypeMismatchException* e) { + delete e; //nothing works, return an empty string. decodedWString = L""; }