From: Evan Nemerson Date: Sat, 15 Sep 2012 18:14:54 +0000 (-0700) Subject: linux: make backtrace_symbols return unowned X-Git-Tag: 0.17.7~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f402af94e8471c8314ee7a312260a776e4d6fbe2;p=thirdparty%2Fvala.git linux: make backtrace_symbols return unowned You are supposed to free() the result of backtrace_symbols, but not each element in the array. The current binding will free each element which will likely result in a crash. Since we don't currently support owned arrays of unowned values (bug #571486), making the whole thing unowned and leaking (unless you call free manually) is the best we can do right now. --- diff --git a/vapi/linux.vapi b/vapi/linux.vapi index 199ee8011..da424d56b 100644 --- a/vapi/linux.vapi +++ b/vapi/linux.vapi @@ -1029,7 +1029,7 @@ namespace Linux { public int backtrace (void* buffer, int size); [CCode (cheader_filename = "execinfo.h", array_length = false)] - public string[] backtrace_symbols (void* buffer, int size); + public unowned string[] backtrace_symbols (void* buffer, int size); [CCode (cheader_filename = "execinfo.h")] public void backtrace_symbols_fd (void* buffer, int size, int fd);