-
Notifications
You must be signed in to change notification settings - Fork 542
[runtime] Rework how we call 'ConformsToProtocol' a little bit. #23002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Use the GCHandle stored on the native instance to find the managed instance to call 'ConformsToProtocol' on, instead of looking up the native handle in our object dictionary. Hopefully fixes this random exception: ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x13d566800 (type: MyType). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'MyType' does not have a constructor that takes one NativeHandle argument). at ObjCRuntime.Runtime.MissingCtor(IntPtr , IntPtr , Type , MissingCtorResolution , IntPtr , RuntimeMethodHandle ) at ObjCRuntime.Runtime.ConstructNSObject[NSObject](IntPtr , Type , MissingCtorResolution , IntPtr , RuntimeMethodHandle ) at ObjCRuntime.Runtime.ConstructNSObject[NSObject](IntPtr , Type , MissingCtorResolution ) at ObjCRuntime.Runtime.ConstructNSObject(IntPtr , IntPtr , MissingCtorResolution ) at ObjCRuntime.Runtime.GetNSObject(IntPtr , MissingCtorResolution , Boolean ) at ObjCRuntime.Runtime.GetNSObject(IntPtr ) at ObjCRuntime.Runtime.InvokeConformsToProtocol(IntPtr , IntPtr ) at ObjCRuntime.Runtime.invoke_conforms_to_protocol(IntPtr obj, IntPtr protocol, IntPtr* exception_gchandle) Exception_EndOfInnerExceptionStack Might fix the following issues: * #21648 * dotnet/maui#28261
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #bdf5acd] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #bdf5acd] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ API diff for current PR / commit.NET ( No breaking changes )✅ API diff vs stable.NET ( No breaking changes )ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [CI Build #bdf5acd] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #bdf5acd] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #bdf5acd] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #bdf5acd] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build #bdf5acd] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
🚀 [CI Build #bdf5acd] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 115 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Use the GCHandle stored on the native instance to find the managed instance to
call 'ConformsToProtocol' on, instead of looking up the native handle in our
object dictionary.
Hopefully fixes this random exception:
This should be a little bit faster.