diff --git a/engine/NamedList.cpp b/engine/NamedList.cpp index 663639ac..831dc0af 100644 --- a/engine/NamedList.cpp +++ b/engine/NamedList.cpp @@ -127,13 +127,13 @@ NamedList& NamedList::clearParam(const String& name, char childSep) } // Remove a specific parameter -NamedList& NamedList::clearParam(NamedString* param) +NamedList& NamedList::clearParam(NamedString* param, bool delParam) { if (!param) return *this; ObjList* o = m_params.find(param); if (o) - o->remove(); + o->remove(delParam); XDebug(DebugInfo,"NamedList::clearParam(%p) found=%p",param,o); return *this; } diff --git a/yateclass.h b/yateclass.h index 91bc8f0f..9871c23d 100644 --- a/yateclass.h +++ b/yateclass.h @@ -3800,9 +3800,10 @@ public: /** * Remove a specific parameter * @param param Pointer to parameter to remove + * @param delParam True to destroy the parameter * @return Reference to this NamedList */ - NamedList& clearParam(NamedString* param); + NamedList& clearParam(NamedString* param, bool delParam = true); /** * Copy a parameter from another NamedList, clears it if not present there