From: Matt Birkholz Date: Thu, 21 Jul 2011 16:59:49 +0000 (-0700) Subject: g_malloc0 nulls GError*s so a GC-cleanup will not free junk. X-Git-Tag: mit-scheme-pucked-9.2.12~666 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=cf8d8af266d372b15739293f4c559e763dfb6ae0;p=mit-scheme.git g_malloc0 nulls GError*s so a GC-cleanup will not free junk. --- 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))