From 3132cb8c42c48c2e82e94ee215c2a7be87a3a8b8 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Fri, 1 Jan 2010 23:33:38 +0900 Subject: [PATCH] don't free result pointers --- tools/genstubs.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/genstubs.scm b/tools/genstubs.scm index fc2c18e0..786a0717 100755 --- a/tools/genstubs.scm +++ b/tools/genstubs.scm @@ -943,9 +943,11 @@ (cat " if (len" i " != " len ")\n" " free(tmp" i ");\n")))) ((and (type-result? a) (not (basic-type? a)) + (not (assq (type-base a) *types*)) (not (type-free? a)) (not (type-pointer? a)) (or (not (type-array a)) (not (integer? (get-array-length func a))))) + ;; the above is hairy - basically this frees temporary strings (cat " free(tmp" (type-index a) ");\n")))) (func-c-args func)) (let* ((results (func-results func))