Take dtor in klass ctor

This is to prevent classes with dangling pointers as destructors.