No, after abc
's destructor ran, its members will be destroyed in reverse order of their declaration. When abc
is deleted, all its memory is free'd. That includes my_def
in your example.
Maybe this question will be useful to you: What is a smart pointer and when should I use one?
Addendum: One major problem with C++ is undefined behavior. Programming errors such as use-after-free may appear to work 80% of the time, if the memory was not reused in the meantime. But chances are that you overwrite unrelated memory and/or allow reading foreign data. That is a severe security problem, and a crashing program is the best you can hope for at this point.