add more docs

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8596 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-01-28 18:58:18 +00:00
commit d3102b4cf9
3 changed files with 91 additions and 17 deletions

View file

@ -545,12 +545,28 @@ void destroy_foo(Foo *foo);
</pre>
</div>
<p> or in a member method as: </p>
<div class="code">
<pre>
%delobject Foo::destroy;
class Foo {
public:
void destroy() { delete this;}
private:
~Foo();
};
</pre>
</div>
<p>
which instructs SWIG that the pointer passed to <tt>destroy_foo</tt> will
be destroyed, and therefore, the target language should not attempt to
deallocate it twice. This is similar to the DISOWN typemap, and in
fact, it also depends on the target language to implement the 'disown'
mechanism properly.
<tt>%delobject</tt> instructs SWIG that the first argument passed to
the method will be destroyed, and therefore, the target language
should not attempt to deallocate it twice. This is similar to use the
DISOWN typemap in the first method argument, and in fact, it also
depends on the target language to implement the 'disown' mechanism
properly.
</p>
<p>