diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-14 14:28:07 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-02-13 01:40:11 +0100 |
commit | 5a9f0cabf6512bcda1c05510a0f6f3affa91bd85 (patch) | |
tree | ce39d024729592e2e71a21468b4e9626dcdecb12 /source3 | |
parent | b59da67d2f6285bfe0275f045a8a18fbd5f19834 (diff) | |
download | samba-5a9f0cabf6512bcda1c05510a0f6f3affa91bd85.tar.gz samba-5a9f0cabf6512bcda1c05510a0f6f3affa91bd85.tar.bz2 samba-5a9f0cabf6512bcda1c05510a0f6f3affa91bd85.zip |
r26454: Add simple SWIG macro for wrapping talloced types.
(cherry picked from talloc parts of commit 760fcc8bfa2a7cd7641465cb3bae889e9e0fbc75)
Michael
(This used to be commit f4c59316b9251477556dd22cdd246607f4dfa845)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/talloc/talloc.i | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/lib/talloc/talloc.i b/source3/lib/talloc/talloc.i index c35d5d2411..c852ae8f9f 100644 --- a/source3/lib/talloc/talloc.i +++ b/source3/lib/talloc/talloc.i @@ -22,3 +22,10 @@ %typemap(in, numinputs=0) TALLOC_CTX * { $1 = NULL; } + +%define %talloctype(TYPE) +%nodefaultctor TYPE; +%extend TYPE { + ~TYPE() { talloc_free($self); } +} +%enddef |