I have a component that I create and then pass it a panel in my main form.
Here is a very simplified example:
procedure TMy_Socket.StatusPanel_Add(AStatusPanel: TPanel);
This component will then update the panel title as needed.
In my main program, if I have a FreeAndNil panel, the next time the component tries to update the panel, I get AV. I understand why: the component link to the panel now indicates the location is undefined.
How can I detect inside a component if the panel has been freed, so I know that I can not refer to it?
I tried if (AStatusPanel = nil) , but it is not nil , it still has an address.
Steve source share