patch 9.0.1035: object members are not being marked as used
Problem: Object members are not being marked as used, garbage collection
may free them.
Solution: Mark object members as used. Fix reference counting.
diff --git a/src/structs.h b/src/structs.h
index 0fb57f4..09b0743 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1487,8 +1487,13 @@
// Used for v_object of typval of VAR_OBJECT.
// The member variables follow in an array of typval_T.
struct object_S {
- class_T *obj_class; // class this object is created for
+ class_T *obj_class; // class this object is created for;
+ // pointer adds to class_refcount
int obj_refcount;
+
+ object_T *obj_next_used; // for list headed by "first_object"
+ object_T *obj_prev_used; // for list headed by "first_object"
+ int obj_copyID; // used by garbage collection
};
#define TTFLAG_VARARGS 0x01 // func args ends with "..."