You could (and imho should) use RAII semantics using unique_prts for this. Writing custom destructors will introduce unnecessary code that you&#x27;ll have to maintain and unnecessary bugs that will creep in eventually.