Implement support for SWIGTYPE* DISOWN typemap

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7381 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-08-23 09:16:34 +00:00
commit 509a391877
3 changed files with 21 additions and 4 deletions

View file

@ -120,6 +120,14 @@ SWIG_Ruby_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
Data_Get_Struct(obj, void, *ptr);
}
/* Check to see if the input object is giving up ownership
of the underlying C struct or C++ object. If so, then
set the free function to nil so that the C struct
is not freed when the Ruby object goes out of scope.*/
if (flags & SWIG_POINTER_DISOWN) {
RDATA(obj)->dfree = 0;
}
/* Do type-checking if type info was provided */
if (ty) {
if (ty->clientdata) {