We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d637d7 commit d5e73a7Copy full SHA for d5e73a7
1 file changed
Common/include/option_structure.inl
@@ -1062,7 +1062,10 @@ struct CStringValuesListHelper {
1062
template <class T>
1063
struct CStringValuesListHelper<T*> {
1064
static T* resize(unsigned short n) { return new T[n]; }
1065
- static void clear(T* ptr) { delete[] ptr; }
+ static void clear(T*& ptr) {
1066
+ delete[] ptr;
1067
+ ptr = nullptr;
1068
+ }
1069
static T& access(T* ptr, unsigned short i) { return ptr[i]; }
1070
};
1071
@@ -1092,6 +1095,8 @@ public:
1092
1095
}
1093
1096
delete[] values;
1094
1097
delete[] strings;
1098
+ values = nullptr;
1099
+ strings = nullptr;
1100
1101
1102
string SetValue(vector<string> option_value) override {
0 commit comments