Runtime: [Question] Why HttpResponseMessage calls GC.SuppressFinalize if it doesn't have a finalizer?

Created on 7 Oct 2020  路  3Comments  路  Source: dotnet/runtime

Hello,
Could you please clarify why HttpResponseMessage calls GC.SuppressFinalize during Dispose if the class doesn't have a finalizer?

As I understand, GC won't finilize an object that doesn't have a finalizer

https://github.com/dotnet/runtime/blob/d6887d4aeec045aa4d708463abdfb6e071660dc8/src/libraries/System.Net.Http/src/System/Net/Http/HttpResponseMessage.cs#L242

area-System.Net.Http question

Most helpful comment

See https://github.com/dotnet/runtime/issues/42183 for a discussion about this topic.

In essence it's about sub-classing and that a sub-class may have a finalizer.

All 3 comments

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

See https://github.com/dotnet/runtime/issues/42183 for a discussion about this topic.

In essence it's about sub-classing and that a sub-class may have a finalizer.

Closing as answered. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

v0l picture v0l  路  3Comments

GitAntoinee picture GitAntoinee  路  3Comments

jamesqo picture jamesqo  路  3Comments

chunseoklee picture chunseoklee  路  3Comments

omajid picture omajid  路  3Comments