Fix ownership of CFSocketCreateRunLoopSource - #6089
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
rolfbjarne
left a comment
There was a problem hiding this comment.
A test would be nice.
See example here: https://github.com/xamarin/xamarin-macios/pull/6091/files
|
I just noticed something. |
|
There's a few other cans of worms I won't open in this PR: |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
* Use function pointers for the new callbacks in .NET. * Misc nullability fixes. * Simplify the construction logic a bit, and make it not leak a GCHandle in case something goes wrong. * Change the Invalidate method to call Dispose, and call CFSocketInvalidate from Dispose, since CFSocketInvalidate must always be called at the end according to Apple's documentation. * Adjust the new test accordingly. * Add a new test verifying that CFSockets are collected by the GC. * This new test revealed a mistake in reference counting (the context's reference count should start out at 0, not 1), which has been fixed. * Rename a few methods and fields to be more explicit. * Update code according to general changes since this PR was introduced.
|
Thanks for taking over ❤️ |
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.
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.
❗ API diff for current PR / commit (Breaking changes)Legacy Xamarin (No breaking changes).NET (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)❗ API diff vs stable (Breaking changes)Legacy Xamarin (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:).NET (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻✅ All tests on macOS M1 - Mac Big Sur (11.5) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🔥 [CI Build] Test results 🔥Test results❌ Tests failed on VSTS: simulator tests 0 tests crashed, 1 tests failed, 222 tests passed. Failures❌ monotouch tests [attempt 2]Details
Html Report (VSDrops) Download Successes✅ bcl: All 69 tests passed. [attempt 2] Html Report (VSDrops) Download Pipeline on Agent |
| } else if (cbType == CFSocketCallBackType.NoCallBack) { | ||
| // nothing to do | ||
| } else if (cbType == CFSocketCallBackType.ReadCallBack) { | ||
| } else if (cbType == CFSocketCallBackType.ReadCallBack && socket.ReadEvent != null) { |
There was a problem hiding this comment.
| } else if (cbType == CFSocketCallBackType.ReadCallBack && socket.ReadEvent != null) { | |
| } else if (cbType == CFSocketCallBackType.ReadCallBack && socket.ReadEvent is not null) { |
| } else if (cbType == CFSocketCallBackType.ReadCallBack && socket.ReadEvent != null) { | ||
| socket.OnRead (new CFSocketReadEventArgs ()); | ||
| } else if (cbType == CFSocketCallBackType.WriteCallBack) { | ||
| } else if (cbType == CFSocketCallBackType.WriteCallBack && socket.WriteEvent != null) { |
There was a problem hiding this comment.
| } else if (cbType == CFSocketCallBackType.WriteCallBack && socket.WriteEvent != null) { | |
| } else if (cbType == CFSocketCallBackType.WriteCallBack && socket.WriteEvent is not null) { |
No description provided.