0
I’m having a problem clearing a Tobjectlist< Tlabel from memory, specifically the Objectlist of the type Tlabel. I created two Objectlist, added an item and tried to clear them from memory: Excerpt from the code:
tolRectMenuItemProntuario := TObjectList<TRectangle>.Create;
tlLabelDadosPaciente := TObjectList<TLabel>.Create();
tlLabelDadosPaciente.Add(lbTituloConvenio);
tolRectMenuItemProntuario.Add(rtMenuItemAnamnese);
tolRectMenuItemProntuario:= nil;
tolRectMenuItemProntuario.DisposeOf;
tlLabelDadosPaciente := nil;
tlLabelDadosPaciente.DisposeOf;
However when deleting try to delete tlLabelDadosPatient, the Tobjectlist< Tlabel>, the error system:
"Project Appsigmedoffline.exe Raised Exception class Einvalidpointer with message 'Invalid Pointer Operation'."
Is there a different way to delete a Tobjectlist< Tlabel>, because I am using the same way the two Objectlist, but only the Tlabel of the error.
It would be nice to add a minimal and complete example so that someone can reproduce what you are finding...
– EMBarbosa