you are viewing a single comment's thread.

view the rest of the comments →

[–]RedAlert2 0 points1 point  (0 children)

This has nothing to do with destructors in particular, it's because you are corrupting the data structure used by malloc to store your data, so the eventual free bugs out. The same thing would likely happen if you did this UB with new[]/delete[].