-2

I was thinking when there was no concept of virtual destructor then all programs developed during that time had memory leak issues or they were using other concept to avoid memory leak?

  • What set of programs or time period are you considering? Even today there are classes which purposefully do not use virtual destructors, [the standard library collections (and prior to that the STL) do not](http://stackoverflow.com/questions/1647298/why-dont-stl-containers-have-virtual-destructors). And there are still people using C doing *fully* manual memory management; and C++ always had virtual destructors. You have to narrow/focus your question and do a bit of reading, to make something besides *"I was thinking..."*. Please see [How to Ask](http://stackoverflow.com/help/how-to-ask) – HostileFork says dont trust SE May 02 '15 at 10:01
  • Thanks HostileFork for links! – Vikram Ojha May 02 '15 at 10:51
  • You're welcome; and I encourage you to remain persistent even with downvotes or having questions put on hold. I learned most everything I know about the advances in C++11 from participating in StackOverflow, over the course of a couple of years. You can learn quickly even just by reading [highly upvoted Q&A](http://stackoverflow.com/questions/tagged/c%2b%2b?sort=votes&pageSize=50). Read as many as you can! Try answering "easy" questions and sometimes not as easy as you think...there may be much better answers showing up. – HostileFork says dont trust SE May 02 '15 at 12:10

1 Answers1

1

No, in general past programs without virtual destructor did not have memory leaks. Talking on C++ virtual destructors were invented at about the same time as other virtual functions and inherritance mechanics so it was somewhat diesigned with virtual destructors builtin.

Those desctructors needed and explicit virtual keyword though.

Peter K
  • 1,787
  • 13
  • 15