upiwin/src/gfxobj.c

31 lines
468 B
C
Raw Normal View History

#include <stdlib.h>
#include "gfxobj.h"
void Go_unchain(PGFXOBJECT obj)
{
if (!(obj->next || obj->prev))
return;
if (obj->next)
obj->next->prev = obj->prev;
if (obj->prev)
obj->prev->next = obj->next;
obj->prev = obj->next = NULL;
}
INT32 Go_addref(PGFXOBJECT obj)
{
return ++(obj->refcnt);
}
INT32 Go_release(PGFXOBJECT obj)
{
int rc = --(obj->refcnt);
if (rc == 0)
{
if (obj->dtor)
(*(obj->dtor))(obj);
free(obj);
}
return rc;
}