extra check only in debug mode
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7894 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0a78185d8a
commit
35ebeba612
1 changed files with 3 additions and 0 deletions
|
|
@ -18,16 +18,19 @@ char cvsroot_base_c[] = "$Header$";
|
||||||
* DohDelete()
|
* DohDelete()
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/* #define SWIG_DEBUG_DELETE */
|
||||||
void
|
void
|
||||||
DohDelete(DOH *obj) {
|
DohDelete(DOH *obj) {
|
||||||
DohBase *b = (DohBase *) obj;
|
DohBase *b = (DohBase *) obj;
|
||||||
DohObjInfo *objinfo;
|
DohObjInfo *objinfo;
|
||||||
|
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
|
#ifdef SWIG_DEBUG_DELETE
|
||||||
if (!DohCheck(b)) {
|
if (!DohCheck(b)) {
|
||||||
fputs("DOH: Fatal error. Attempt to delete a non-doh object.\n",stderr);
|
fputs("DOH: Fatal error. Attempt to delete a non-doh object.\n",stderr);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (b->flag_intern) return;
|
if (b->flag_intern) return;
|
||||||
assert(b->refcount > 0);
|
assert(b->refcount > 0);
|
||||||
b->refcount--;
|
b->refcount--;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue