Skip to content

Commit

Permalink
fix a segfault when using GtkTreeListModel
Browse files Browse the repository at this point in the history
The root model is passed in with "transfer full".
  • Loading branch information
jwahlstrand committed Sep 21, 2023
1 parent c6f3926 commit d51ff5e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lists.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ get_item(trl::GtkTreeListRow) = G_.get_item(trl)
function GtkTreeListModel(root::GListModel, passthrough, autoexpand, create_func)
create_cfunc = @cfunction(GtkTreeListModelCreateModelFunc, Ptr{GObject}, (Ptr{GObject},Ref{Function}))
ref, deref = GLib.gc_ref_closure(create_func)
GLib.glib_ref(root)
ret = ccall(("gtk_tree_list_model_new", libgtk4), Ptr{GObject}, (Ptr{GObject}, Cint, Cint, Ptr{Nothing}, Ptr{Nothing}, Ptr{Nothing}), root, passthrough, autoexpand, create_cfunc, ref, deref)
convert(GtkTreeListModel, ret, true)
end
Expand Down

0 comments on commit d51ff5e

Please sign in to comment.