diff --git a/GI/src/giimport.jl b/GI/src/giimport.jl index 5fd6d4f5..adabf1d8 100644 --- a/GI/src/giimport.jl +++ b/GI/src/giimport.jl @@ -683,7 +683,7 @@ function convert_from_c(name::Symbol, arginfo::ArgInfo, typeinfo::TypeDesc{T}) w if elmtype.gitype == GObject return :(arrtemp=collect(unsafe_wrap(Vector{$elmctype}, $name,$lensymb[]));GLib.g_free($name);arrtemp=convert.($(elmtype.jtype), arrtemp, false)) elseif elmctype == :(Ptr{UInt8}) || elmctype == :(Cstring) - return :(bytestring.(unsafe_wrap(Vector{$elmctype}, $name, $lensymb[]),true)) + return :(arrtemp=bytestring.(unsafe_wrap(Vector{$elmctype}, $name, $lensymb[]),false);GLib.g_free($name);arrtemp) else return :(arrtemp=collect(unsafe_wrap(Vector{$elmctype}, $name,$lensymb[]));GLib.g_free($name);arrtemp) end diff --git a/src/gen/glib_methods b/src/gen/glib_methods index 28201f45..6f8371cd 100644 --- a/src/gen/glib_methods +++ b/src/gen/glib_methods @@ -1973,7 +1973,11 @@ $(Expr(:toplevel, quote function get_bytestring_array(instance::GVariant) m_length = Ref{UInt64}() ret = ccall(("g_variant_get_bytestring_array", libglib), Ptr{Cstring}, (Ptr{GVariant}, Ptr{UInt64}), instance, m_length) - ret2 = bytestring.(unsafe_wrap(Vector{Cstring}, ret, m_length[]), true) + ret2 = begin + arrtemp = bytestring.(unsafe_wrap(Vector{Cstring}, ret, m_length[]), false) + GLib.g_free(ret) + arrtemp + end _length = m_length[] ret2 end @@ -2025,7 +2029,11 @@ $(Expr(:toplevel, quote function get_objv(instance::GVariant) m_length = Ref{UInt64}() ret = ccall(("g_variant_get_objv", libglib), Ptr{Cstring}, (Ptr{GVariant}, Ptr{UInt64}), instance, m_length) - ret2 = bytestring.(unsafe_wrap(Vector{Cstring}, ret, m_length[]), true) + ret2 = begin + arrtemp = bytestring.(unsafe_wrap(Vector{Cstring}, ret, m_length[]), false) + GLib.g_free(ret) + arrtemp + end _length = m_length[] ret2 end @@ -2043,7 +2051,11 @@ $(Expr(:toplevel, quote function get_strv(instance::GVariant) m_length = Ref{UInt64}() ret = ccall(("g_variant_get_strv", libglib), Ptr{Cstring}, (Ptr{GVariant}, Ptr{UInt64}), instance, m_length) - ret2 = bytestring.(unsafe_wrap(Vector{Cstring}, ret, m_length[]), true) + ret2 = begin + arrtemp = bytestring.(unsafe_wrap(Vector{Cstring}, ret, m_length[]), false) + GLib.g_free(ret) + arrtemp + end _length = m_length[] ret2 end