Skip to content

Conversation

@AnthonyNjuguna
Copy link

Description of Change

Added the ability to set the handler outside of the constructor so when it is re-used from the pool the handler will not be null and cause crashes like #20612

Issues Fixed

Fixes #20612

@AnthonyNjuguna AnthonyNjuguna requested a review from a team as a code owner April 3, 2025 15:25
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Apr 3, 2025
@dotnet dotnet deleted a comment from azure-pipelines bot Apr 7, 2025
@dotnet dotnet deleted a comment from jsuarezruiz Apr 7, 2025
@dotnet dotnet deleted a comment from azure-pipelines bot Apr 7, 2025
@jfversluis
Copy link
Member

jfversluis commented Apr 24, 2025

There are some build errors here

C:\a_work\1\s\src\Core\maps\src\Platform\iOS\MauiMKMapView.cs(19,10): error CS8618: Non-nullable field '_handlerRef' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable. [C:\a_work\1\s\src\Core\maps\src\Maps.csproj::TargetFramework=net9.0-maccatalyst18.0]
C:\a_work\1\s\src\Core\maps\src\Platform\iOS\MauiMKMapView.cs(27,4): error RS0016: Symbol 'Handler.get' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [C:\a_work\1\s\src\Core\maps\src\Maps.csproj::TargetFramework=net9.0-maccatalyst18.0]
C:\a_work\1\s\src\Core\maps\src\Platform\iOS\MauiMKMapView.cs(32,4): error RS0016: Symbol 'Handler.set' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [C:\a_work\1\s\src\Core\maps\src\Maps.csproj::TargetFramework=net9.0-maccatalyst18.0]
C:\a_work\1\s\src\Core\maps\src\Platform\iOS\MauiMKMapView.cs(19,10): error CS8618: Non-nullable field '_handlerRef' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable. [C:\a_work\1\s\src\Core\maps\src\Maps.csproj::TargetFramework=net9.0-ios18.0]
C:\a_work\1\s\src\Core\maps\src\Platform\iOS\MauiMKMapView.cs(27,4): error RS0016: Symbol 'Handler.get' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [C:\a_work\1\s\src\Core\maps\src\Maps.csproj::TargetFramework=net9.0-ios18.0]
C:\a_work\1\s\src\Core\maps\src\Platform\iOS\MauiMKMapView.cs(32,4): error RS0016: Symbol 'Handler.set' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [C:\a_work\1\s\src\Core\maps\src\Maps.csproj::TargetFramework=net9.0-ios18.0]
7414 Warning(s)
6 Error(s)

Also this introduces new public APIs. If we want to fix this for .NET 9 we will need to find a way to do it without that, else it will probably be a fix for .NET 10. What we probably can do is make the public members internal for now?

Can you please address these @AnthonyNjuguna ?

@karthikraja-arumugam
Copy link
Contributor

This also fixes the issue #29346

@sheiksyedm
Copy link
Contributor

@PureWeen @jfversluis We’ve fixed the build errors and added a test for the fix in the PR below. Could you please close this PR in favor of the new one?
#29369

@jsuarezruiz
Copy link
Contributor

@AnthonyNjuguna Could you rebase and fix the conflict? Thanks in advance.

@sheiksyedm
Copy link
Contributor

Closed favor of this PR #29369

@sheiksyedm sheiksyedm closed this Jun 4, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-map Map / Maps community ✨ Community Contribution platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disconnecting Map Handler causes Map to crash on second page entrance and moving to region.

5 participants