finalizer
How do I terminate a worker thread when the owning object is collected?
I have an object that has a BackgroundWorker thread (purely a queue of Action delegates). i.e., it\'s the common, simple single-producer single-consumer scenario.[详细]
2023-03-13 03:49 分类:问答How to add a safe guarded to release the resource that should have been released explicitly by the client code
The user is supposed to call Player.close() to release some critical resources managed by the native code and kill several internal java threads created for the player object. However,the user failed[详细]
2023-03-10 03:43 分类:问答There's no destructor in Visual C#?
As I understand, the destructor syntax (~ClassName) in C# is a way to write a finalizer. This method becomes Finalize method after compiling to the IL.[详细]
2023-03-03 12:09 分类:问答C#: In a finalizer, how to find out if the application is shutting down?
I have a finalizer that seems to always fail during application shutdown. I think this is because it\'s holding onto some native resources that are no longer valid at that point. Is there a way to tel[详细]
2023-02-27 00:40 分类:问答F# Equivalent of Destructor
I am t开发者_运维百科ranslating a C# class that wraps an unmanaged library to F#. I have run into the seemingly simple problem of rewriting the destructor that follows.[详细]
2023-02-25 06:18 分类:问答How finalize method works with phantom reference in java
Hi I have one doubt about phantom reference. What I understand the finalize method is called just before when object are going for garbage collection. But some time if object are not eligible for garb[详细]
2023-02-25 02:41 分类:问答Finalizer not called
I have a class in C# where I want to c开发者_运维百科lose out some communication ports properly when my class is being disposed.However, the finalizer is never being called when I exit the program.Why[详细]
2023-02-14 18:32 分类:问答IDisposable with destructor: requires thread-safe implementation?
This is pretty much only for me to make sure, I got this right: We have a large resource class implementing the IDisposal pattern. It should (by design) be implemented in a way, that enables it to g[详细]
2023-02-04 20:36 分类:问答Two questions about Dispose() and destructors in C#
I have a question about how to use Dispose() and destructors. Reading some articles and the MSDN documentation, this seems to be the recommended way of implementing Dispose() and destructors.[详细]
2023-02-02 14:53 分类:问答C++/CLI: preventing garbage collection on managed wrapper of unmanaged resource
I have a C++ unmanaged class NativeDog that needs to be used from C#, so I\'ve create a wrapper class ManagedDog.[详细]
2023-01-29 06:02 分类:问答
加载中,请稍侯......