]> gitweb.factorcode.org Git - factor.git/commitdiff
images.loader.gtk: Add with-destructors. Fixes #1893.
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 29 Dec 2017 21:23:15 +0000 (15:23 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 29 Dec 2017 21:25:16 +0000 (15:25 -0600)
Also did this on imac: cd /usr/local/lib && ln -s /opt/local/lib/libgobject-2.0.dylib .

basis/images/loader/gtk/gtk-tests.factor

index ada2194fe17ebd12f1047c4d73d4935e0c302da5..17dad964c8d6110c97a872f454ba68eed3e90c88 100644 (file)
@@ -1,21 +1,25 @@
 USING: accessors arrays continuations gdk.pixbuf.ffi glib.ffi gobject.ffi
 images.loader images.loader.gtk images.loader.gtk.private io
-io.encodings.binary io.files kernel tools.test ;
+io.encodings.binary io.files kernel tools.test destructors ;
 IN: images.loader.gtk.tests
 
 : open-png-image ( -- image )
     "vocab:images/testing/png/basi0g01.png" load-image ;
 
 { t } [
-    open-png-image [ dim>> ] [
-        image>GdkPixbuf &g_object_unref
-        [ gdk_pixbuf_get_width ] [ gdk_pixbuf_get_height ] bi 2array
-    ] bi =
+    [
+        open-png-image [ dim>> ] [
+            image>GdkPixbuf &g_object_unref
+            [ gdk_pixbuf_get_width ] [ gdk_pixbuf_get_height ] bi 2array
+        ] bi =
+    ] with-destructors
 ] unit-test
 
 { t } [
     [
-        open-png-image image>GdkPixbuf &g_object_unref
-        "frob" GdkPixbuf>byte-array
-    ] [ g-error? ] recover
+        [
+            open-png-image image>GdkPixbuf &g_object_unref
+            "frob" GdkPixbuf>byte-array
+        ] [ g-error? ] recover
+    ] with-destructors
 ] unit-test