The main WinRT interface is based on COM. Each WinRT interface comes from IUnknown, its AddRef and Release methods implement memory management based on reference counting.
However, this is very well hidden when you are programming a WinRT application, then you are using a language projector. For .NET and Javascript applications, language projection is built into the CLR and Chakra engine, respectively. Which completely hide implementation details, WinRT interfaces are mapped to native language constructs. Including skillfully creating the illusion that COM supports generics and implementation inheritance. A somewhat reasonable guess is that the CLR projection uses the support for COM interoperability already built into the CLR, but this cannot be easily rebuilt. To be precise, finalizers are likely to make an IUnknown :: Release () call.
Now itβs very difficult to get decent information about low-level details, Microsoft bloggers and SO posters donβt say, the source code is not available, and issues affecting the topic are closed, for example this one .
As you can tell from Chen's comment on this, you should not be interested in this. If you're worried, think about C ++ / CX programming. What is good to hide the glue. Or native C ++ with the WRL library, but it is not. Both runtimes in which memory management is explicit. Microsoft has invested a lot of resources to reuse C ++ programming.
source share