[vala] linux: make backtrace_symbols return unowned
- From: Evan Nemerson <evann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] linux: make backtrace_symbols return unowned
- Date: Sat, 15 Sep 2012 23:28:24 +0000 (UTC)
commit f402af94e8471c8314ee7a312260a776e4d6fbe2
Author: Evan Nemerson <evan coeus-group com>
Date: Sat Sep 15 11:14:54 2012 -0700
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.
vapi/linux.vapi | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/vapi/linux.vapi b/vapi/linux.vapi
index 199ee80..da424d5 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]