Requery a tlist

Hi,

I have a tlist that is a sourcelist to an aureliusdataset. According to some options must change the results of it and reset is to the sourcelist.

take a look at the code, it is place on a closeup event of a lookupcombobox
var SUBCLASS:TList<TSUBCLASS>;
begin
  SUBCLASS:=uniMainModule.MainObjMgr.Find<TSUBCLASS>
  .Add(Linq['CLASSID']=adsMAINCLASSCLASSID.AsString)
  .List;
  adsSubClass.Close;
  adssubclass.SetSourceList(subclass);
  adsSubClass.Open;
  comboSUBCLASS.Enabled:=True;
...
Is something that should I take care about memory issues;

Regard,
Nikos

Yes, you should destroy SUBCLASS list eventually. Alternatively you can use it this way and no care about list destruction:


begin
  adsSubClass.Close;
  adssubclass.SetSourceCriteria(
    uniMainModule.MainObjMgr.Find<TSUBCLASS>
    .Add(Linq['CLASSID']=adsMAINCLASSCLASSID.AsString)
  );
  adsSubClass.Open;
  comboSUBCLASS.Enabled:=True;

Ok I already destroy it but your way is way better...

Thanks Wagner