开发者

How memory is managed for C# objects when C++ code uses as C# class?

How memory is managed for C# objects when C++ code uses as C# class?

NOTE: I am not specific in this question 开发者_如何转开发but just wondering how it is done.


It works exactly the same... objects that are not reachable by managed code are eligible for garbage collection so if your unmanaged code is relying on managed resources to continue existing you must hold a reference to it somewhere in the c# side of the app.

edit: this applies to unmanaged c++


Managed C++ uses the ordinary garbage collector.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜