OK repeat after me ...
-
... i will never ever write a base class without a virtual destructor :mad:
I don't believe in failure. It is not failure if you enjoyed the process.
i will never ever write a base class without a virtual destructor Hey, i never ever write a base class without a virtual destructor.
-
... i will never ever write a base class without a virtual destructor :mad:
I don't believe in failure. It is not failure if you enjoyed the process.
-
... i will never ever write a base class without a virtual destructor :mad:
I don't believe in failure. It is not failure if you enjoyed the process.
:laugh::laugh: How long did it take you to locate the error?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998
"...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above -
... i will never ever write a base class without a virtual destructor :mad:
I don't believe in failure. It is not failure if you enjoyed the process.
for(int i = 0;i < 100;i++) { print("I will never ever write a base class without a virtual destructor."); }
:-D:-D"Courage choose who will follow, Fate choose who will lead" - Lord Gunner, Septerra Core "Press any key to continue, where's the ANY key ?" - Homer Simpsons Drinking gives me amazing powers of insight. I can solve all the worlds problems when drunk, but can never remember the solutions in the morning. - Michael P Butler to Paul Watson on 12/08/03
-
:laugh::laugh: How long did it take you to locate the error?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998
"...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying aboveRoger Stoltz wrote:
How long did it take you to locate the error?
Running in debug mode detected memory leaks (it was an abstract base class) and after a good solid hour or so of rearranging code it hit me to check and me the supreme coder havn't even added a destructor :mad:
I can only please one person a day... today is not your day
-
... i will never ever write a base class without a virtual destructor :mad:
I don't believe in failure. It is not failure if you enjoyed the process.
-
... i will never ever write a base class without a virtual destructor :mad:
I don't believe in failure. It is not failure if you enjoyed the process.
-
Roger Stoltz wrote:
How long did it take you to locate the error?
Running in debug mode detected memory leaks (it was an abstract base class) and after a good solid hour or so of rearranging code it hit me to check and me the supreme coder havn't even added a destructor :mad:
I can only please one person a day... today is not your day
-
for(int i = 0;i < 100;i++) { print("I will never ever write a base class without a virtual destructor."); }
:-D:-D"Courage choose who will follow, Fate choose who will lead" - Lord Gunner, Septerra Core "Press any key to continue, where's the ANY key ?" - Homer Simpsons Drinking gives me amazing powers of insight. I can solve all the worlds problems when drunk, but can never remember the solutions in the morning. - Michael P Butler to Paul Watson on 12/08/03
why only 100?;P
:badger:
-
... i will never ever write a base class without a virtual destructor :mad:
I don't believe in failure. It is not failure if you enjoyed the process.
... i will never ever write a base class without a virtual destructor. ;P
Weiye Chen Give me the Death Note, and I'll cleanse the world...
-
GNU GCC points out the error when compiled with -Wall option.
-
... i will never ever write a base class without a virtual destructor :mad:
I don't believe in failure. It is not failure if you enjoyed the process.
You probably know about this already, but I hope somebody finds this of some use: The Rule of Three[^] :)
Cheers, Vikram.
"Life isn't fair, and the world is full of unscrupulous characters. There are things worth fighting for, killing for and dying for, but it's a really small list. Chalk it up to experience, let it go, and move on to the next positive experience in your life." - Christopher Duncan.
-
You probably know about this already, but I hope somebody finds this of some use: The Rule of Three[^] :)
Cheers, Vikram.
"Life isn't fair, and the world is full of unscrupulous characters. There are things worth fighting for, killing for and dying for, but it's a really small list. Chalk it up to experience, let it go, and move on to the next positive experience in your life." - Christopher Duncan.
-
... i will never ever write a base class without a virtual destructor :mad:
I don't believe in failure. It is not failure if you enjoyed the process.
I hate tracking down things like this. Not a good way to spend the day! This (among many others) is one of the reasons we use PCLint[^] to help check our code. It's awsome. The output by itself is not that friendly, but there are a number of tools that help present and filter the information for you in a much more useful manner.We use our own in house one. So much time can be wasted on small problems like these ones, so anything that helps us identify them, that has gotta be good. - Phil
-
I hate tracking down things like this. Not a good way to spend the day! This (among many others) is one of the reasons we use PCLint[^] to help check our code. It's awsome. The output by itself is not that friendly, but there are a number of tools that help present and filter the information for you in a much more useful manner.We use our own in house one. So much time can be wasted on small problems like these ones, so anything that helps us identify them, that has gotta be good. - Phil
-
... i will never ever write a base class without a virtual destructor :mad:
I don't believe in failure. It is not failure if you enjoyed the process.
...Effective C++[^]. ;)
Anna :rose: Linting the day away :cool: Anna's Place | Tears and Laughter "If mushy peas are the food of the devil, the stotty cake is the frisbee of God"
-
hmm thanks i will take a look at it, Anna here works on visual lint i think.
Steady As She Goes!
I do indeed. :) If there's anything you need to know, feel free to ask. Our own stuff aside, we're developing quite an insight into how to tune PC-Lint to make the output useful...
Anna :rose: Linting the day away :cool: Anna's Place | Tears and Laughter "If mushy peas are the food of the devil, the stotty cake is the frisbee of God"
-
...Effective C++[^]. ;)
Anna :rose: Linting the day away :cool: Anna's Place | Tears and Laughter "If mushy peas are the food of the devil, the stotty cake is the frisbee of God"
-
In C# compiler add it for you, doesn't it..? just a good practise in the manage world
L.W.C. Nirosh. Colombo, Sri Lanka.
In C#, the thing that has a destructor syntax is a finalizer. It is recommended to avoid manually adding one. But if you want to use the Dispose pattern you have to add one. Still whatever you do, you can't know when that memory will be released... (Which might be never, if you forget to let go of that reference)