+2020-12-11 Tom Tromey <tom@tromey.com>
+
+ * varobj.c (varobj_clear_saved_item): Remove.
+ (update_dynamic_varobj_children): Update.
+ (varobj::~varobj): Don't call varobj_clear_saved_item.
+
2020-12-11 Tom Tromey <tom@tromey.com>
* varobj.c (install_dynamic_child, varobj_clear_saved_item)
requested an iterator from a non-dynamic varobj"));
}
-/* Release and clear VAR's saved item, if any. */
-
-static void
-varobj_clear_saved_item (struct varobj_dynamic *var)
-{
- if (var->saved_item != NULL)
- var->saved_item.reset (nullptr);
-}
-
static bool
update_dynamic_varobj_children (struct varobj *var,
std::vector<varobj *> *changed,
if (update_children || var->dynamic->child_iter == NULL)
{
var->dynamic->child_iter = varobj_get_iterator (var);
-
- varobj_clear_saved_item (var->dynamic);
+ var->dynamic->saved_item.reset (nullptr);
i = 0;
}
#endif
- varobj_clear_saved_item (var->dynamic);
-
if (is_root_p (var))
delete var->root;