mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
13 lines
288 B
C
13 lines
288 B
C
#include "weakref.h"
|
|
|
|
Arg* weakref_ref(PikaObj* self, Arg* aObj) {
|
|
if (arg_isObject(aObj)) {
|
|
PikaObj* obj = arg_getPtr(aObj);
|
|
Arg* ret = arg_copy(aObj);
|
|
obj_refcntDec(obj);
|
|
arg_setIsWeakRef(ret, PIKA_TRUE);
|
|
return ret;
|
|
}
|
|
return NULL;
|
|
}
|