...
This commit is contained in:
@@ -12,7 +12,7 @@ void *rc_alloc(size_t size, void (*destructor)(void *self))
|
||||
exit(69);
|
||||
}
|
||||
|
||||
header->ref_count = 0;
|
||||
header->ref_count = 1;
|
||||
header->destructor = destructor;
|
||||
|
||||
return (void *)(header + 1);
|
||||
@@ -29,7 +29,7 @@ void rc_release(void *obj)
|
||||
{
|
||||
ref_header *header = ((ref_header *)obj) - 1;
|
||||
printf("rc_release\n");
|
||||
if (--header->ref_count <= 0)
|
||||
if (--header->ref_count == 0)
|
||||
{
|
||||
if (header->destructor)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user