From 52c53fa57f873cc87918f25b3dc7bb1fde9c104f Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sat, 13 Jun 2026 14:48:52 +0100 Subject: [PATCH] fx: string: implement iterator destructor --- fx/string.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fx/string.c b/fx/string.c index 6c9976c..bdc2999 100644 --- a/fx/string.c +++ b/fx/string.c @@ -1574,10 +1574,9 @@ static fx_status get_length( /*** ITERATOR FUNCTIONS *******************************************************/ -static void iterator_fini(fx_iterator *obj) +static void iterator_fini(fx_object *obj, void *priv) { - struct fx_string_iterator_p *it - = fx_object_get_private(obj, FX_TYPE_STRING_ITERATOR); + struct fx_string_iterator_p *it = priv; if (it->_tmp) { fx_string_unref(it->_tmp); } @@ -1840,4 +1839,5 @@ FX_TYPE_DEFINITION_BEGIN(fx_string_iterator) FX_TYPE_EXTENDS(FX_TYPE_ITERATOR); FX_TYPE_CLASS(fx_string_iterator_class); FX_TYPE_INSTANCE_PRIVATE(struct fx_string_iterator_p); + FX_TYPE_INSTANCE_FINI(iterator_fini); FX_TYPE_DEFINITION_END(fx_string_iterator)