diff src/typval.c @ 31404:60b1d266548d v9.0.1035

patch 9.0.1035: object members are not being marked as used Commit: https://github.com/vim/vim/commit/d28d7b94f5a76a817585c115dbf6fecac9b0b4cd Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 8 20:42:00 2022 +0000 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.
author Bram Moolenaar <Bram@vim.org>
date Thu, 08 Dec 2022 21:45:03 +0100
parents 307f68a41b03
children f7c82a85e88a
line wrap: on
line diff
--- a/src/typval.c
+++ b/src/typval.c
@@ -85,7 +85,7 @@ free_tv(typval_T *varp)
 		break;
 #endif
 	    case VAR_CLASS:
-		class_unref(varp);
+		class_unref(varp->vval.v_class);
 		break;
 	    case VAR_OBJECT:
 		object_unref(varp->vval.v_object);
@@ -161,7 +161,7 @@ clear_tv(typval_T *varp)
 		VIM_CLEAR(varp->vval.v_instr);
 		break;
 	    case VAR_CLASS:
-		class_unref(varp);
+		class_unref(varp->vval.v_class);
 		break;
 	    case VAR_OBJECT:
 		object_unref(varp->vval.v_object);