Solved

Multiple destructors?

Posted on 1998-09-17
4
371 Views
Last Modified: 2010-05-18
I have a number of destuctors in one form that I call depending on the constructor I use:

     destructor DestroyRepSpds;
     destructor DestroyRuleSpds;
     destructor DestroyDefs;

I just found out on this forum that I need to add override, when I do I get a compiler error message saying Method 'DestroyRepSpds' not found in base class.

Is it wrong to have multiple destructors?

Thanks, Tom.

0
Comment
Question by:tomcorcoran
  • 2
4 Comments
 
LVL 1

Expert Comment

by:pjdb
Comment Utility
override is needed only if the parent class have the same method. In you case, the parent class does not have the DestroyRepSpds method some there is nothing to override.

JDB
0
 

Author Comment

by:tomcorcoran
Comment Utility
JDB,

Thanks, makes sense, give an answer, so I can grade.

Tom.
0
 
LVL 1

Expert Comment

by:Marcius
Comment Utility
You should also make sure that you call inherited destroy, I think. Otherwise the memory may not be cleared correctly. I am not sure about this, since I can't remember if the procedure being declared as destructor makes sure that inherited destroy is called.

Just a thought.
0
 
LVL 1

Accepted Solution

by:
pjdb earned 50 total points
Comment Utility
Marcius is right, but i've assume that Tom already know it ;-)
In fact any time you write a message handler and a method that override a parent's method you are hardy advise to call the method inherited frrom the parent in order to pocess the message correctly.

JDB
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now