尝试释放对象时,请确保将查询对象设置为null。当您将其设置为null时,它将确定释放内存。但是作用域也起着作用,因此请确保它在过程中是本地的。
请找到样本片段以供参考
myFunction := TSAPFunctions.Create;
myFunction.Connection := FConnection;
myFunction.RemoveAll;
myQuery := mySAPFunction.Add('interface here');
myQuery.Call;
myQuery := null; // will clear the memory
希望这可以帮助!