I have some code for freeing a class instance that can be shared amongst several classes. When this class is shared I only want the class where it was created to be able to free it. The name of the class which created it is stored in the OWNER_NAME field. Currently I pass the name of class being destroyed as a parameter when this is called inside the destructor.
What type of class is TTABLE_WHERE?
Why don't you just use the standard Owner parameter of TComponent?
So just inherit TTABLE_WHERE from TComponent (or higher) and you can use TTABLE_WHERE.Create(Owner).
After that... the owner will automatically Free the TTABLE_WHERE when it's destroyed.
If you really want to mess with calling Free like this for a non-owner-like component, then you might want to pass a pointer instead of a Name. But my guess is that you complicate things too much at this point (by not following the standard methods available to you).
Is there a way to do this without using a parameter for the ownername. Is it possible to get the information about the class calling the procedure maybe?
Yes, there is. But you first need to show us the interface of that TTABLE_WHERE.