Skip to content

Commit 683b6c5

Browse files
committed
Delete destructor for IniFinder to suppress Cppcheck warning on missing
copy constructor and assignment operator.
1 parent 6f4be30 commit 683b6c5

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

matepath/src/matepath.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3065,11 +3065,6 @@ struct IniFinder {
30653065
portable = false;
30663066
}
30673067
}
3068-
~IniFinder() {
3069-
if (appData != nullptr) {
3070-
CoTaskMemFree(appData);
3071-
}
3072-
}
30733068
IniFindStatus CheckIniFile(LPWSTR lpszFile) noexcept;
30743069
};
30753070

@@ -3178,6 +3173,9 @@ void FindIniFile() noexcept {
31783173
lstrcpy(szIniFile2, tchTest);
31793174
SetStrEmpty(szIniFile);
31803175
}
3176+
if (finder.appData != nullptr) {
3177+
CoTaskMemFree(finder.appData);
3178+
}
31813179
}
31823180

31833181
bool CreateIniFile(LPCWSTR lpszIniFile) noexcept {

src/Notepad4.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6421,11 +6421,6 @@ struct IniFinder {
64216421
portable = false;
64226422
}
64236423
}
6424-
~IniFinder() {
6425-
if (appData != nullptr) {
6426-
CoTaskMemFree(appData);
6427-
}
6428-
}
64296424
IniFindStatus CheckIniFile(LPWSTR lpszFile) noexcept;
64306425
};
64316426

@@ -6534,6 +6529,9 @@ void FindIniFile() noexcept {
65346529
lstrcpy(szIniFile2, tchTest);
65356530
SetStrEmpty(szIniFile);
65366531
}
6532+
if (finder.appData != nullptr) {
6533+
CoTaskMemFree(finder.appData);
6534+
}
65376535
}
65386536

65396537
void FindExtraIniFile(LPWSTR lpszIniFile, LPCWSTR defaultName, LPCWSTR redirectKey) noexcept {

0 commit comments

Comments
 (0)