diff --git a/LibGit2Sharp/Core/Handles/Objects.cs b/LibGit2Sharp/Core/Handles/Objects.cs index ddca49bee..18b79b616 100644 --- a/LibGit2Sharp/Core/Handles/Objects.cs +++ b/LibGit2Sharp/Core/Handles/Objects.cs @@ -18,7 +18,7 @@ internal TreeEntryHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_tree_entry_free((git_tree_entry*)AsIntPtr()); + NativeMethods.git_tree_entry_free((git_tree_entry*)handle); return true; } @@ -43,7 +43,7 @@ internal ReferenceHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_reference_free((git_reference*)AsIntPtr()); + NativeMethods.git_reference_free((git_reference*)handle); return true; } @@ -68,7 +68,7 @@ internal RepositoryHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_repository_free((git_repository*)AsIntPtr()); + NativeMethods.git_repository_free((git_repository*)handle); return true; } @@ -93,7 +93,7 @@ internal SignatureHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_signature_free((git_signature*)AsIntPtr()); + NativeMethods.git_signature_free((git_signature*)handle); return true; } @@ -118,7 +118,7 @@ internal StatusListHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_status_list_free((git_status_list*)AsIntPtr()); + NativeMethods.git_status_list_free((git_status_list*)handle); return true; } @@ -143,7 +143,7 @@ internal BlameHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_blame_free((git_blame*)AsIntPtr()); + NativeMethods.git_blame_free((git_blame*)handle); return true; } @@ -168,7 +168,7 @@ internal DiffHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_diff_free((git_diff*)AsIntPtr()); + NativeMethods.git_diff_free((git_diff*)handle); return true; } @@ -193,7 +193,7 @@ internal PatchHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_patch_free((git_patch*)AsIntPtr()); + NativeMethods.git_patch_free((git_patch*)handle); return true; } @@ -218,7 +218,7 @@ internal ConfigurationHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_config_free((git_config*)AsIntPtr()); + NativeMethods.git_config_free((git_config*)handle); return true; } @@ -243,7 +243,7 @@ internal ConflictIteratorHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_index_conflict_iterator_free((git_index_conflict_iterator*)AsIntPtr()); + NativeMethods.git_index_conflict_iterator_free((git_index_conflict_iterator*)handle); return true; } @@ -268,7 +268,7 @@ internal IndexHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_index_free((git_index*)AsIntPtr()); + NativeMethods.git_index_free((git_index*)handle); return true; } @@ -293,7 +293,7 @@ internal ReflogHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_reflog_free((git_reflog*)AsIntPtr()); + NativeMethods.git_reflog_free((git_reflog*)handle); return true; } @@ -318,7 +318,7 @@ internal TreeBuilderHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_treebuilder_free((git_treebuilder*)AsIntPtr()); + NativeMethods.git_treebuilder_free((git_treebuilder*)handle); return true; } @@ -343,7 +343,7 @@ internal PackBuilderHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_packbuilder_free((git_packbuilder*)AsIntPtr()); + NativeMethods.git_packbuilder_free((git_packbuilder*)handle); return true; } @@ -368,7 +368,7 @@ internal NoteHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_note_free((git_note*)AsIntPtr()); + NativeMethods.git_note_free((git_note*)handle); return true; } @@ -393,7 +393,7 @@ internal DescribeResultHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_describe_result_free((git_describe_result*)AsIntPtr()); + NativeMethods.git_describe_result_free((git_describe_result*)handle); return true; } @@ -418,7 +418,7 @@ internal SubmoduleHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_submodule_free((git_submodule*)AsIntPtr()); + NativeMethods.git_submodule_free((git_submodule*)handle); return true; } @@ -443,7 +443,7 @@ internal AnnotatedCommitHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_annotated_commit_free((git_annotated_commit*)AsIntPtr()); + NativeMethods.git_annotated_commit_free((git_annotated_commit*)handle); return true; } @@ -468,7 +468,7 @@ internal ObjectDatabaseHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_odb_free((git_odb*)AsIntPtr()); + NativeMethods.git_odb_free((git_odb*)handle); return true; } @@ -493,7 +493,7 @@ internal RevWalkerHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_revwalk_free((git_revwalk*)AsIntPtr()); + NativeMethods.git_revwalk_free((git_revwalk*)handle); return true; } @@ -518,7 +518,7 @@ internal RemoteHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_remote_free((git_remote*)AsIntPtr()); + NativeMethods.git_remote_free((git_remote*)handle); return true; } @@ -543,7 +543,7 @@ internal ObjectHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_object_free((git_object*)AsIntPtr()); + NativeMethods.git_object_free((git_object*)handle); return true; } @@ -568,7 +568,7 @@ internal RebaseHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_rebase_free((git_rebase*)AsIntPtr()); + NativeMethods.git_rebase_free((git_rebase*)handle); return true; } @@ -593,7 +593,7 @@ internal OdbStreamHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_odb_stream_free((git_odb_stream*)AsIntPtr()); + NativeMethods.git_odb_stream_free((git_odb_stream*)handle); return true; } @@ -618,7 +618,7 @@ internal WorktreeHandle(IntPtr ptr, bool owned) protected override bool ReleaseHandle() { - NativeMethods.git_worktree_free((git_worktree*)AsIntPtr()); + NativeMethods.git_worktree_free((git_worktree*)handle); return true; } diff --git a/LibGit2Sharp/Core/Handles/Objects.tt b/LibGit2Sharp/Core/Handles/Objects.tt index e522bd859..7202fa819 100644 --- a/LibGit2Sharp/Core/Handles/Objects.tt +++ b/LibGit2Sharp/Core/Handles/Objects.tt @@ -84,7 +84,7 @@ for (var i = 0; i < cNames.Length; i++) protected override bool ReleaseHandle() { - NativeMethods.<#= cNames[i] #>_free((<#= cNames[i] #>*)AsIntPtr()); + NativeMethods.<#= cNames[i] #>_free((<#= cNames[i] #>*)handle); return true; }