diff --git a/FDTD/operator_cylinder.cpp b/FDTD/operator_cylinder.cpp index 0b5eefd..87f7c60 100644 --- a/FDTD/operator_cylinder.cpp +++ b/FDTD/operator_cylinder.cpp @@ -307,7 +307,10 @@ void Operator_Cylinder::ApplyMagneticBC(bool* dirs) void Operator_Cylinder::AddExtension(Operator_Extension* op_ext) { if (op_ext->IsCylinderCoordsSave(CC_closedAlpha, CC_R0_included)) - m_Op_exts.push_back(op_ext); + Operator_Multithread::AddExtension(op_ext); else + { + delete op_ext; cerr << "Operator_Cylinder::AddExtension: Warning: Operator extension \"" << op_ext->GetExtensionName() << "\" is not compatible with cylinder-coords!! skipping...!" << endl; + } } diff --git a/FDTD/operator_cylindermultigrid.cpp b/FDTD/operator_cylindermultigrid.cpp index 2758e66..f4f92c5 100644 --- a/FDTD/operator_cylindermultigrid.cpp +++ b/FDTD/operator_cylindermultigrid.cpp @@ -498,6 +498,7 @@ void Operator_CylinderMultiGrid::AddExtension(Operator_Extension* op_ext) //check whether extension is save to use in multi-grid if (op_ext->IsCylindricalMultiGridSave(false)==false) { + delete op_ext; cerr << "Operator_CylinderMultiGrid::AddExtension: Warning: Operator extension \"" << op_ext->GetExtensionName() << "\" is not compatible with cylindrical multi-grids!! skipping...!" << endl; return; }