mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-24 05:20:17 +00:00
fix rc leak
This commit is contained in:
parent
3a257aefb1
commit
026171e753
@ -11,7 +11,12 @@ typedef struct RefCounted {
|
|||||||
} RefCounted;
|
} RefCounted;
|
||||||
|
|
||||||
#define PK_INCREF(obj) (obj)->rc.count++
|
#define PK_INCREF(obj) (obj)->rc.count++
|
||||||
#define PK_DECREF(obj) if (--(obj)->rc.count == 0) (obj)->rc.dtor(obj)
|
#define PK_DECREF(obj) do { \
|
||||||
|
if(--(obj)->rc.count == 0) { \
|
||||||
|
(obj)->rc.dtor(obj); \
|
||||||
|
free(obj); \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user