diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-14 14:28:07 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:50:22 +0100 |
commit | df8c7da800f75ff45fb48de59d7ce3f0667d375f (patch) | |
tree | 65c17e04d7f2e83d2266b6f71ef04c8e79a94d3f /source4/lib/talloc/talloc.i | |
parent | 43ac3d9b44b98d44db9b1550c47e8f96a410d1e9 (diff) | |
download | samba-df8c7da800f75ff45fb48de59d7ce3f0667d375f.tar.gz samba-df8c7da800f75ff45fb48de59d7ce3f0667d375f.tar.bz2 samba-df8c7da800f75ff45fb48de59d7ce3f0667d375f.zip |
r26454: Add simple SWIG macro for wrapping talloced types.
(This used to be commit 760fcc8bfa2a7cd7641465cb3bae889e9e0fbc75)
Diffstat (limited to 'source4/lib/talloc/talloc.i')
-rw-r--r-- | source4/lib/talloc/talloc.i | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/lib/talloc/talloc.i b/source4/lib/talloc/talloc.i index c35d5d2411..c852ae8f9f 100644 --- a/source4/lib/talloc/talloc.i +++ b/source4/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 |