]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
linux: make backtrace_symbols return unowned
authorEvan Nemerson <evan@coeus-group.com>
Sat, 15 Sep 2012 18:14:54 +0000 (11:14 -0700)
committerEvan Nemerson <evan@coeus-group.com>
Sat, 15 Sep 2012 23:27:50 +0000 (16:27 -0700)
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.

vapi/linux.vapi

index 199ee80114c69aa8702c27d08bad78d180f3168e..da424d56b2e6c447cf1ff4e226e3f73174aa6394 100644 (file)
@@ -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);