From 4c8803214724c7f9977494a3e2b54d7455e59c05 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Thu, 29 Jun 2023 19:35:29 +0800 Subject: [PATCH] fix https://github.com/blueloveTH/pocketpy/issues/101 --- src/obj.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/obj.h b/src/obj.h index 95435c8b..09054734 100644 --- a/src/obj.h +++ b/src/obj.h @@ -401,7 +401,11 @@ struct Py_ final: PyObject { Py_(Type type, NativeFunc val): PyObject(type), _value(val) { enable_instance_dict(); } - void _obj_gc_mark() override {} + void _obj_gc_mark() override { + if(_value.decl != nullptr){ + _value.decl->_gc_mark(); + } + } }; template<>