Skip to content

Commit

Permalink
define finalizers
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Dec 30, 2016
1 parent 87c6240 commit f790e88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1347,4 +1347,8 @@ function quadgk(args...)
end
export quadgk

# #19660
@deprecate finalize(sa::LibGit2.StrArrayStruct) close(sa)
@deprecate finalize(sa::LibGit2.Buffer) close(sa)

# End deprecations scheduled for 0.6
1 change: 1 addition & 0 deletions base/libgit2/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ for (typ, ref, sup, fnc) in (
function $typ(ptr::Ptr{$ref})
@assert ptr != C_NULL
obj = new(ptr)
finalizer(obj, close)
return obj
end
end
Expand Down

0 comments on commit f790e88

Please sign in to comment.