From cf8d8af266d372b15739293f4c559e763dfb6ae0 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Thu, 21 Jul 2011 09:59:49 -0700 Subject: [PATCH] g_malloc0 nulls GError*s so a GC-cleanup will not free junk. --- src/gtk/gio.scm | 5 ++--- src/gtk/gtk.cdecl | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gtk/gio.scm b/src/gtk/gio.scm index 8ae5dd709..5554a9472 100644 --- a/src/gtk/gio.scm +++ b/src/gtk/gio.scm @@ -136,9 +136,8 @@ USA. (gerror* (g-input-stream-cancel-info-gerror-pointer info))) (add-gc-cleanup object (make-g-input-stream-cleanup info)) - ((ucode-primitive c-malloc 2) gerror* (C-sizeof "*")) - (error-if-null gerror* "Could not create:" gerror*) - (C->= gerror* "*" 0))) + (C-call "g_malloc0" gerror* (C-sizeof "*")) + (error-if-null gerror* "Could not create:" gerror*))) (define (make-g-input-stream-cleanup info) (named-lambda (g-input-stream-cleanup) diff --git a/src/gtk/gtk.cdecl b/src/gtk/gtk.cdecl index 02c44ebab..2e207336b 100644 --- a/src/gtk/gtk.cdecl +++ b/src/gtk/gtk.cdecl @@ -36,6 +36,10 @@ USA. ;;; gio.scm +(extern gpointer + g_malloc0 + (n_bytes gsize)) + (callback void async_ready (source (* GObject)) -- 2.25.1