Skip to content

Commit

Permalink
Fix location for Inline callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-Muhandis committed Jan 28, 2024
1 parent bdf773a commit 11d254a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tgtypes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -898,10 +898,8 @@ constructor TCallbackQueryObj.Create(JSONObject: TJSONObject);

destructor TCallbackQueryObj.Destroy;
begin
if Assigned(FMessage) then
FMessage.Free;
if Assigned(FFrom) then
FFrom.Free;
FMessage.Free;
FFrom.Free;
inherited Destroy;
end;

Expand All @@ -924,15 +922,13 @@ constructor TTelegramInlineQueryObj.Create(JSONObject: TJSONObject);
FOffset:=fJSON.Get('offset', '');

FFrom:=TTelegramUserObj.CreateFromJSONObject(fJSON.Find('from', jtObject) as TJSONObject) as TTelegramUserObj;
FLocation:=TTelegramUserObj.CreateFromJSONObject(fJSON.Find('location', jtObject) as TJSONObject) as TTelegramLocation;
FLocation:=TTelegramLocation.CreateFromJSONObject(fJSON.Find('location', jtObject) as TJSONObject) as TTelegramLocation;
end;

destructor TTelegramInlineQueryObj.Destroy;
begin
if Assigned(FLocation) then
FLocation.Free;
if Assigned(FFrom) then
FFrom.Free;
FLocation.Free;
FFrom.Free;
inherited Destroy;
end;

Expand Down

0 comments on commit 11d254a

Please sign in to comment.