Skip to content

Commit 601feb5

Browse files
committed
cant have nice things
1 parent d5e73a7 commit 601feb5

2 files changed

Lines changed: 9 additions & 16 deletions

File tree

Common/include/option_structure.inl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,18 +1054,13 @@ public:
10541054
template <class T>
10551055
struct CStringValuesListHelper {
10561056
static T resize(unsigned short) { return T(); }
1057-
static void clear(T&) {}
10581057
static T& access(T& val, unsigned short) { return val; }
10591058
};
10601059

10611060
// Specialization for pointer types (multiple values per string).
10621061
template <class T>
10631062
struct CStringValuesListHelper<T*> {
10641063
static T* resize(unsigned short n) { return new T[n]; }
1065-
static void clear(T*& ptr) {
1066-
delete[] ptr;
1067-
ptr = nullptr;
1068-
}
10691064
static T& access(T* ptr, unsigned short i) { return ptr[i]; }
10701065
};
10711066

@@ -1089,16 +1084,6 @@ public:
10891084
name(name_), size(size_), strings(strings_), values(values_), num_vals(optional_num_vals) {
10901085
}
10911086

1092-
~COptionStringValuesList() override {
1093-
for (unsigned short i = 0; i < size; i++) {
1094-
CStringValuesListHelper<Type>::clear(values[i]);
1095-
}
1096-
delete[] values;
1097-
delete[] strings;
1098-
values = nullptr;
1099-
strings = nullptr;
1100-
};
1101-
11021087
string SetValue(vector<string> option_value) override {
11031088
COptionBase::SetValue(option_value);
11041089
unsigned short option_size = option_value.size();

Common/src/CConfig.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ void CConfig::SetPointersNull(void) {
858858
Inlet_Ttotal = nullptr; Inlet_Ptotal = nullptr;
859859
Inlet_FlowDir = nullptr; Inlet_Temperature = nullptr; Inlet_Pressure = nullptr;
860860
Inlet_Velocity = nullptr; Inlet_MassFrac = nullptr;
861-
Outlet_Pressure = nullptr;
861+
Outlet_Pressure = nullptr; Inlet_SpeciesVal = nullptr;
862862

863863
/*--- Engine Boundary Condition settings ---*/
864864

@@ -7930,6 +7930,13 @@ CConfig::~CConfig(void) {
79307930
delete[] FlowLoad_Value;
79317931
delete[] Roughness_Height;
79327932
delete[] Wall_Emissivity;
7933+
7934+
if (Inlet_SpeciesVal != nullptr) {
7935+
for (auto i = 0u; i < nMarker_Inlet_Species; ++i)
7936+
delete[] Inlet_SpeciesVal[i];
7937+
}
7938+
delete[] Inlet_SpeciesVal;
7939+
79337940
/*--- related to periodic boundary conditions ---*/
79347941

79357942
for (iMarker = 0; iMarker < nMarker_PerBound; iMarker++) {
@@ -7986,6 +7993,7 @@ CConfig::~CConfig(void) {
79867993
delete[] Marker_Internal;
79877994
delete[] Marker_HeatFlux;
79887995
delete[] Marker_Emissivity;
7996+
delete[] Marker_Inlet_Species;
79897997

79907998
delete [] Int_Coeffs;
79917999

0 commit comments

Comments
 (0)