src/stdlib/object.c
/*=================================================
 * delete_obj -- release or delete object as appropriate
 * obj may be null
 *===============================================*/
- release or delete object as appropriate
obj may be null
- release or delete object as appropriate obj may be null
void
delete_obj (OBJECT obj)
{
	VTABLE vtable;
	if (!obj) return; 
	vtable = (*obj);
	ASSERT(vtable->vtable_magic == VTABLE_MAGIC);
	if ((*vtable->isref_fnc)(obj)) {
		(*vtable->release_fnc)(obj);
	} else {
		(*vtable->destroy_fnc)(obj);
	}
}
void delete_obj ( OBJECT obj ) { VTABLE vtable ; if ( ! obj ) return ; vtable = ( * obj ) ; ASSERT ( vtable -> vtable_magic == VTABLE_MAGIC ) ; if ( ( * vtable -> isref_fnc ) ( obj ) ) { ( * vtable -> release_fnc ) ( obj ) ; } else { ( * vtable -> destroy_fnc ) ( obj ) ; } }
delete_obj -- release or delete object as appropriate
 obj may be null
delete_obj -- release or delete object as appropriate obj may be null
/* Like C++ delete, may be called on NULL */ /* refcounted */ /* non-refcounted */