Skip to content

Commit 9e82f30

Browse files
committed
Fix wrong handle lifecycle
git_branch_delete() only frees the handle upon success.
1 parent 580dee6 commit 9e82f30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

LibGit2Sharp/Core/Proxy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ public static void git_branch_delete(ReferenceSafeHandle reference)
161161
using (ThreadAffinity())
162162
{
163163
int res = NativeMethods.git_branch_delete(reference);
164-
reference.SetHandleAsInvalid();
165164
Ensure.ZeroResult(res);
165+
reference.SetHandleAsInvalid();
166166
}
167167
}
168168

0 commit comments

Comments
 (0)