add owndata field to swig_type_info, so clientdata can be properly delete if needed

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7822 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-11-08 15:53:30 +00:00
commit f2d1e94900
2 changed files with 9 additions and 3 deletions

View file

@ -67,6 +67,7 @@ typedef struct swig_type_info {
swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
struct swig_cast_info *cast; /* linked list of types that can cast into this type */
void *clientdata; /* language specific type data */
int owndata; /* flag if the structure owns the clientdata */
} swig_type_info;
/* Structure to store a type and conversion function used for casting */
@ -253,7 +254,12 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
cast = cast->next;
}
}
SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
SWIG_TypeClientData(ti, clientdata);
ti->owndata = 1;
}
/*
Search for a swig_type_info structure only by mangled name
Search is a O(log #types)