tristanlabelle / swift-winrt

A Swift bindings generator for WinRT APIs
MIT License
15 stars 1 forks source link

Fix inner object initialization #72

Closed tristanlabelle closed 3 months ago

tristanlabelle commented 3 months ago

The outer object should be ready to respond to AddRef/Release. It is currently uninitialized. This is causing CompositionTests.testDerived to crash.


            // Create the inner object using a valid pointer to an uninitialized outer object.
            var inner: IInspectablePointer? = nil
            self.outer = .uninitialized
            let composed: UnsafeMutablePointer<Interface>? = try _factory(IInspectablePointer.cast(outer.unknownPointer), &inner)
tristanlabelle commented 3 months ago

Fixed in https://github.com/tristanlabelle/swift-winrt/commit/879c052ce7e94a3ead94ee5855bd2bc150efc443