microsoft / dotnet

This repo is the official home of .NET on GitHub. It's a great starting point to find many .NET OSS projects from Microsoft and the community, including many that are part of the .NET Foundation.
https://devblogs.microsoft.com/dotnet/
MIT License
14.43k stars 2.21k forks source link

Destructor Not Being Called #1414

Open Ibrahimogod opened 1 year ago

Ibrahimogod commented 1 year ago

I tried to use Destructor in a simple class and I found It's not calling class Destructor when object goes outside the scope but I tried the same approach with IDisposable and it worked fine if you need the code example let me know but it was kinda weird

azizbek-abdurahmonov commented 1 year ago

Assalomu Alaykum! Can you send me your code?

WeihanLi commented 10 months ago

The deconstructor may not be called immediately, it may relate to GC processing