]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r26454: Add simple SWIG macro for wrapping talloced types.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 14 Dec 2007 13:28:07 +0000 (14:28 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 13 Feb 2008 00:40:11 +0000 (01:40 +0100)
(cherry picked from talloc parts of commit 760fcc8bfa2a7cd7641465cb3bae889e9e0fbc75)

Michael

source/lib/talloc/talloc.i

index c35d5d24116851ccd9b035969ffe368ad930b240..c852ae8f9fd4df8cace84b05f79c76c7b1892956 100644 (file)
 %typemap(in, numinputs=0) TALLOC_CTX * {
     $1 = NULL;
 }
+
+%define %talloctype(TYPE)
+%nodefaultctor TYPE;
+%extend TYPE {
+    ~TYPE() { talloc_free($self); }
+}
+%enddef