Search it in windows
Releasing WinRT Runtime Classes

As I understand it, all references to Windows Runtime Classes are Interfaces. When handling projected types of the Interfaces/Objects we are inherently holding a smart pointer. But how do we release a reference to the underlying object? It makes no sense to cast to the implementation, or to get IUknown somehow and calling release(). There's no function on the projected type to release. The winrt::final_release function seems to have been deprecated. There doesn't seem to be any other winrt function. ~IUknown does not sound like it would decrement the count. My only conclusion is to IInterface = nullptr. Great if that's the answer, and it might even work, but still be not the right answer.
I edited my question. It's ridiculously simple. COM ISomeInterface MyInterface . . . . MyInterface->release(); Windows Runtime (projected type) ISomeInterface MyInterface, no idea how to release a reference.
WinUI 3.0 . . . not sure how that matters, C++/WinRT.
I guess C++ might matter.
Sign in to comment