Index: ProScan/UI/DnaCodeReedsGescandScherm.pas =================================================================== diff -u -r410 -r479 --- ProScan/UI/DnaCodeReedsGescandScherm.pas (.../DnaCodeReedsGescandScherm.pas) (revision 410) +++ ProScan/UI/DnaCodeReedsGescandScherm.pas (.../DnaCodeReedsGescandScherm.pas) (revision 479) @@ -99,10 +99,14 @@ procedure TfmDnaCodeReedsGescandScherm.Verplaatsen; var Response: HernoemPalletResponse; + fAgent: TAgent; begin if not TCommonFunctions.IsKaderdeurLocatie(edtPallet.Text) then edtPallet.Text := UpperCase(edtPallet.Text); - Response := TAgent.Create(UiContext).HernoemPallet(UiContext.Pallet, edtPallet.Text, UiContext.LaatsteDnaCode); + + fAgent := TAgent.Create(UiContext); + Response := fAgent.HernoemPallet(UiContext.Pallet, edtPallet.Text, UiContext.LaatsteDnaCode); + fAgent.Free; try if Response.Header.Status <> '200' then begin ToonPopupScherm(Response.Header.Omschrijving, 'Probeer opnieuw','') @@ -122,8 +126,11 @@ procedure TfmDnaCodeReedsGescandScherm.Wegnemen; var Response: DnaCodeAfmeldenResponse; + fAgent: TAgent; begin - Response := TAgent.Create(UiContext).DnaCodeAfmelden(UiContext.LaatsteDnaCode,UiContext.Toelevering,UiContext.Pallet,-1,''); + fAgent := TAgent.Create(UiContext); + Response := fAgent.DnaCodeAfmelden(UiContext.LaatsteDnaCode,UiContext.Toelevering,UiContext.Pallet,-1,''); + fAgent.Free; try if Response.Header.Status <> '200' then begin ToonPopupScherm(Response.Header.Omschrijving, 'Probeer opnieuw','') @@ -138,8 +145,11 @@ function TfmDnaCodeReedsGescandScherm.GeefStatusVanDnaCode(Code: string): DnaCodeStatus; var Response: ZoekViaDnaCodeResponse; + fAgent: TAgent; begin - Response := TAgent.Create(UiContext).ZoekViaDnaCode(Code); + fAgent := TAgent.Create(UiContext); + Response := fAgent.ZoekViaDnaCode(Code); + fAgent.Free; try begin result := DnaCodeStatus(Response.DnaCodes);