From dcadafa1b87f80cf3b0feb110b5ba704ba17448a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Mon, 25 Mar 2024 15:47:30 +0100 Subject: [PATCH] * Fix memleak --- packages/fcl-web/examples/fcm/cli/sendmsg.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/fcl-web/examples/fcm/cli/sendmsg.pp b/packages/fcl-web/examples/fcm/cli/sendmsg.pp index 041118f8fe..eed7266eae 100644 --- a/packages/fcl-web/examples/fcm/cli/sendmsg.pp +++ b/packages/fcl-web/examples/fcm/cli/sendmsg.pp @@ -64,6 +64,7 @@ Var Obj : TJSONObject absolute D; begin + D:=Nil; F:=TFileStream.Create(aFileName,fmOpenRead or fmShareDenyWrite); try D:=GetJSON(F); @@ -73,6 +74,7 @@ begin Msg.Body:=Obj.Get('body',Msg.Body); Msg.Image:=Obj.Get('image',Msg.Image); finally + D.Free; F.Free; end; end; @@ -80,7 +82,6 @@ end; procedure TFCMApplication.ConfigureMessage(Msg : TNotificationMessage); - begin if HasOption('m','message') then LoadMessageFromFile(Msg,GetOptionValue('m','message')); @@ -90,7 +91,6 @@ begin Msg.Body:=GetoptionValue('b','body'); if HasOption('i','image') then Msg.Body:=GetoptionValue('i','image'); - end; procedure TFCMApplication.DoHandleNewToken(Sender: TObject; const aToken: TBearerToken);