DohDelete and DohCopy assertions called if not a DOH object

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11897 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2010-03-04 21:45:26 +00:00
commit d399c1a04c

View file

@ -30,12 +30,15 @@ void DohDelete(DOH *obj) {
if (!obj)
return;
#if SWIG_DEBUG_DELETE
if (!DohCheck(b)) {
#if SWIG_DEBUG_DELETE
fputs("DOH: Fatal error. Attempt to delete a non-doh object.\n", stderr);
abort();
}
#else
assert(0);
#endif
return;
}
if (b->flag_intern)
return;
assert(b->refcount > 0);
@ -62,6 +65,15 @@ DOH *DohCopy(const DOH *obj) {
if (!obj)
return 0;
if (!DohCheck(b)) {
#if SWIG_DEBUG_DELETE
fputs("DOH: Fatal error. Attempt to copy a non-doh object.\n", stderr);
abort();
#else
assert(0);
#endif
return 0;
}
objinfo = b->type;
if (objinfo->doh_copy) {
DohBase *bc = (DohBase *) (objinfo->doh_copy) (b);