[SearchKit] Subclass NativeObject + numerous other code updates - #13152
Merged
Conversation
* Subclass NativeObject to reuse object lifetime code. * Enable nullability and fix code accordingly. * Use 'is' and 'is not' instead of '==' and '!=' for object identity. * Use CFString.CreateNative/ReleaseNative instead of other means to create native strings (the fastest and least memory hungry option). * Use the null-safe NativeObjectExtensions.GetHandle extension method to get the handle instead of checking for null (avoids some code duplication). * Use 'nameof (parameter)' instead of string constants. * Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and throwing ObjectDisposedException. * Use the 'Runtime.GetNSObject<T> (IntPtr, bool)' overload to specify handle ownership, to avoid having to call NSObject.DangerousReleaes manually later.
Collaborator
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffView dotnet API diffView dotnet legacy API diffGitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results4 tests failed, 95 tests passed.Failed tests
Pipeline on Agent XAMBOT-1099.BigSur' |
mandel-macaque
approved these changes
Oct 28, 2021
Collaborator
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffView dotnet API diffView dotnet legacy API diffAPI & Generator diffℹ️ API Diff (from PR only) (please review changes) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results2 tests failed, 97 tests passed.Failed tests
Pipeline on Agent XAMBOT-1101.BigSur' |
Member
Author
|
Test failures are unrelated
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
native strings (the fastest and least memory hungry option).
the handle instead of checking for null (avoids some code duplication).
Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and
throwing ObjectDisposedException.
ownership, to avoid having to call NSObject.DangerousReleaes manually later.