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:
parent
1253657bb4
commit
d399c1a04c
1 changed files with 14 additions and 2 deletions
|
|
@ -30,12 +30,15 @@ void DohDelete(DOH *obj) {
|
||||||
|
|
||||||
if (!obj)
|
if (!obj)
|
||||||
return;
|
return;
|
||||||
#if SWIG_DEBUG_DELETE
|
|
||||||
if (!DohCheck(b)) {
|
if (!DohCheck(b)) {
|
||||||
|
#if SWIG_DEBUG_DELETE
|
||||||
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();
|
||||||
}
|
#else
|
||||||
|
assert(0);
|
||||||
#endif
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (b->flag_intern)
|
if (b->flag_intern)
|
||||||
return;
|
return;
|
||||||
assert(b->refcount > 0);
|
assert(b->refcount > 0);
|
||||||
|
|
@ -62,6 +65,15 @@ DOH *DohCopy(const DOH *obj) {
|
||||||
|
|
||||||
if (!obj)
|
if (!obj)
|
||||||
return 0;
|
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;
|
objinfo = b->type;
|
||||||
if (objinfo->doh_copy) {
|
if (objinfo->doh_copy) {
|
||||||
DohBase *bc = (DohBase *) (objinfo->doh_copy) (b);
|
DohBase *bc = (DohBase *) (objinfo->doh_copy) (b);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue