I'm having a problem clearing a TObjectList < TLabel & gt ;, in specific ObjectList of type TLabel. I created two ObjectList, added an item and tried to clear them from memory: Code snippet:
tolRectMenuItemProntuario := TObjectList<TRectangle>.Create;
tlLabelDadosPaciente := TObjectList<TLabel>.Create();
tlLabelDadosPaciente.Add(lbTituloConvenio);
tolRectMenuItemProntuario.Add(rtMenuItemAnamnese);
tolRectMenuItemProntuario:= nil;
tolRectMenuItemProntuario.DisposeOf;
tlLabelDadosPaciente := nil;
tlLabelDadosPaciente.DisposeOf;
While deleting try to delete the PatientLabelData, the TObjectList < TLabel>, the system error:
"
"Is there any way to delete a TObjectList < TLabel>, because I'm using the same way both ObjectList, but only the TLabel of the error.