From f790e889b719b2be7b891ca90f4115af28b25fae Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 30 Dec 2016 23:24:41 +0000 Subject: [PATCH] define finalizers --- base/deprecated.jl | 4 ++++ base/libgit2/types.jl | 1 + 2 files changed, 5 insertions(+) diff --git a/base/deprecated.jl b/base/deprecated.jl index 661c16353b0dc..4791dd0b4143e 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -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 diff --git a/base/libgit2/types.jl b/base/libgit2/types.jl index 66e5120d974fc..3eb0948e33a74 100644 --- a/base/libgit2/types.jl +++ b/base/libgit2/types.jl @@ -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