crategus / cl-cffi-gtk

cl-cffi-gtk is a Lisp binding to the GTK+ 3 library.
http://www.crategus.com/books/cl-cffi-gtk
146 stars 33 forks source link

BUG: gtk-text-iters are never deallocated #65

Open stacksmith opened 5 years ago

stacksmith commented 5 years ago

Unless I am missing something. There is no binding for gtk-text-iter-free

 (get 'gtk::gtk-text-iter 'gobject::g-boxed-foreign-info)
#S(GOBJECT::G-BOXED-OPAQUE-WRAPPER-INFO
   :NAME GTK-TEXT-ITER
   :TYPE "GtkTextIter"
   :ALLOC NIL
   :FREE NIL)

There seems to be no provision for freeing iters, which are erroneously allocated all over the place (see related issue #64). Edit: Freeing iters requires g_slice_free see https://github.com/GNOME/gtk/blob/master/gtk/gtktextiter.c

stacksmith commented 5 years ago

Actually, iters may be allocated anywhere; only iters created by GTK internally and using gtk-text-iter-copyneed to be deallocated using gtk-text-iter-free. It would make more sense to foreign-alloc them and manage them as any foreign object.