29 lines
431 B
C
29 lines
431 B
C
|
|
#include <stdlib.h>
|
|
#include <assert.h>
|
|
|
|
#include <debug.h>
|
|
|
|
#include "inheritance.h"
|
|
#include "struct.h"
|
|
#include "free.h"
|
|
|
|
void free_ostream(
|
|
struct ostream* this)
|
|
{
|
|
ENTER;
|
|
|
|
if (this && !--this->refcount)
|
|
{
|
|
assert(this);
|
|
assert(this->inheritance);
|
|
assert(this->inheritance->free);
|
|
|
|
(this->inheritance->free)(this);
|
|
|
|
free(this);
|
|
}
|
|
|
|
EXIT;
|
|
}
|
|
|