Browse Source

fix https://github.com/blueloveTH/pocketpy/issues/101

blueloveTH 2 years ago
parent
commit
4c88032147
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/obj.h

+ 5 - 1
src/obj.h

@@ -401,7 +401,11 @@ struct Py_<NativeFunc> 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<>