Skip to content

Cleanup of managed resources in the finalizer? #31199

@berrs

Description

@berrs

Is it safe to access object members from a finalizer? I'm talking about normal managed members here, nothing unmanaged. The recommendation used to be that the finalizer should only touch unmanaged resources, since there was no guarantee that managed members were still alive at the time of finalization. However, this page does not mention that at all, so is that recommendation no longer necessesary? Because if it is, I definitely think the page should mention it.

Regards

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.


Associated WorkItem - 477083

Metadata

Metadata

Labels

📌 seQUESTeredIdentifies that an issue has been imported into Quest.dotnet-csharp/svcfundamentals/subsvcin-prThis issue will be closed (fixed) by an active pull request.okr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.

Type

No type

Projects

Status

👀 In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions