object deletion bookkeeping
Remove some obfree() vs dealloc_obj() confusion.
This commit is contained in:
+3
-1
@@ -14,6 +14,7 @@ STATIC_DCL void FDECL(check_contained, (struct obj *,const char *));
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern struct obj *thrownobj; /* defined in dothrow.c */
|
extern struct obj *thrownobj; /* defined in dothrow.c */
|
||||||
|
extern struct obj *kickobj; /* dokick.c */
|
||||||
|
|
||||||
/*#define DEBUG_EFFECTS*/ /* show some messages for debugging */
|
/*#define DEBUG_EFFECTS*/ /* show some messages for debugging */
|
||||||
|
|
||||||
@@ -1799,7 +1800,8 @@ dealloc_obj(obj)
|
|||||||
if (obj_sheds_light(obj))
|
if (obj_sheds_light(obj))
|
||||||
del_light_source(LS_OBJECT, obj_to_any(obj));
|
del_light_source(LS_OBJECT, obj_to_any(obj));
|
||||||
|
|
||||||
if (obj == thrownobj) thrownobj = (struct obj*)0;
|
if (obj == thrownobj) thrownobj = 0;
|
||||||
|
if (obj == kickobj) kickobj = 0;
|
||||||
|
|
||||||
if (obj->oextra) dealloc_oextra(obj->oextra);
|
if (obj->oextra) dealloc_oextra(obj->oextra);
|
||||||
free((genericptr_t) obj);
|
free((genericptr_t) obj);
|
||||||
|
|||||||
@@ -857,8 +857,6 @@ register struct obj *obj, *merge;
|
|||||||
can't call remove_worn_item() to get <X>_off() side-effects */
|
can't call remove_worn_item() to get <X>_off() side-effects */
|
||||||
setnotworn(obj);
|
setnotworn(obj);
|
||||||
}
|
}
|
||||||
if (obj == thrownobj) thrownobj = 0;
|
|
||||||
if (obj == kickobj) kickobj = 0;
|
|
||||||
dealloc_obj(obj);
|
dealloc_obj(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user