I can’t make work the finalizer. I have this type A :
type A
i::Int64
function A(i::Int64)
a = new(i)
println("typeof(a) = $(typeof(a))")
println("constructor $(a.i)")
finalizer(a, destructor)
end
end
destructor(a::A) = println("destructor $(a.i)")
And when I instanciate a = A(1)
, I get those errors :
typeof(a) = A
constructor 1
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF