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.25k stars 2.2k forks source link

Destructor Not Being Called #1414

Open Ibrahimogod opened 8 months ago

Ibrahimogod commented 8 months 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 7 months ago

Assalomu Alaykum! Can you send me your code?

WeihanLi commented 6 months ago

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