]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.backend.gtk: add destructor in clipboard-contents
authorAnton Gorenko <ex.rzrjck@gmail.com>
Sun, 13 Jun 2010 10:18:51 +0000 (16:18 +0600)
committerAnton Gorenko <ex.rzrjck@gmail.com>
Sun, 13 Jun 2010 10:18:51 +0000 (16:18 +0600)
basis/glib/ffi/ffi.factor
basis/ui/backend/gtk/gtk.factor

index 51fa3af04c5dc85f97acae78b257e3bcae2be580..99183a88dc7ada495357e3a68eadc4ad5766be70 100644 (file)
@@ -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 ) ;
index 3a2835c1b1289c170f37c7d031e4f5403e7fb431..045a75d075ab341e18e1e30661e83db83db74c73 100644 (file)
@@ -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*