diff --git a/basis/glib/ffi/ffi.factor b/basis/glib/ffi/ffi.factor index 51fa3af04c..99183a88dc 100644 --- a/basis/glib/ffi/ffi.factor +++ b/basis/glib/ffi/ffi.factor @@ -72,6 +72,7 @@ IMPLEMENT-STRUCTS: GPollFD GSource GSourceFuncs ; GIR: vocab:glib/GLib-2.0.gir DESTRUCTOR: g_source_unref +DESTRUCTOR: g_free CALLBACK: gboolean GSourceFuncsPrepareFunc ( GSource* source, gint* timeout_ ) ; CALLBACK: gboolean GSourceFuncsCheckFunc ( GSource* source ) ; diff --git a/basis/ui/backend/gtk/gtk.factor b/basis/ui/backend/gtk/gtk.factor index 3a2835c1b1..045a75d075 100644 --- a/basis/ui/backend/gtk/gtk.factor +++ b/basis/ui/backend/gtk/gtk.factor @@ -466,7 +466,10 @@ M:: gtk-ui-backend system-alert ( caption text -- ) [ gtk_widget_destroy ] tri ; M: gtk-clipboard clipboard-contents - handle>> gtk_clipboard_wait_for_text utf8 alien>string ; + [ + handle>> gtk_clipboard_wait_for_text + [ &g_free utf8 alien>string ] [ f ] if* + ] with-destructors ; M: gtk-clipboard set-clipboard-contents swap [ handle>> ] [ utf8 string>alien ] bi*