If any marker is selected on a MapView using this:
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := TCloseAction.caFree;
end;
The app crash right after the form is closed.
But, if using this:
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
try
MapView1.DisposeOf;
finally
Action := TCloseAction.caFree;
end;
end;
The app doesn't crash, but an Access violation message is fired after the form is closed. What may be causing this? There is someway to avoid it?
Best regards
Edit:
Actually I was adding markers to the map in the wrong way. You cannot add TMarkerDescriptor like this:
You must use a TMapMarker like this:
However, you must use:
on
OnFormClosefor every marker you add to the map to avoid crash, like this: