LazMapViewer: Fix potential crash when setting the PluginManager for the MapView (part of issue , patch by @iluha.companets)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9622 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2025-02-10 21:59:42 +00:00
parent 8959750876
commit ad7d4dea27

View File

@ -2686,10 +2686,13 @@ procedure TMapView.SetPluginManager(AValue: TMvCustomPluginManager);
begin
if FPluginManager = AValue then
exit;
if FPluginManager <> nil then
begin
RemoveFreeNotification(FPluginManager);
if AValue = nil then
FPlugInManager.RemoveMapView(Self);
if AValue = nil then
FPlugInManager.RemoveMapView(Self);
end;
FPluginManager := AValue;