From 83db3d819b7402b4f3c6ca023ddfea6204fae4b4 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Tue, 26 Apr 2022 00:26:43 -0300 Subject: Invalidate Fields on Entries::drop --- src/lib.rs | 8 ++++---- src/list.rs | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 0852a24..f0ee389 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -149,11 +149,11 @@ * -[ ] gtkwin_ptr * -[ ] win_ptr * -[x] hexchat_get_prefs - * -[ ] hexchat_list_get + * -[x] hexchat_list_get * -[ ] hexchat_list_fields - * -[ ] hexchat_list_next - * -[ ] hexchat_list_str - * -[ ] hexchat_list_int + * -[x] hexchat_list_next + * -[x] hexchat_list_str + * -[x] hexchat_list_int * -[ ] hexchat_list_time * -[x] ~~hexchat_list_free~~ not available - use Drop impls. * -[x] hexchat_hook_command diff --git a/src/list.rs b/src/list.rs index 257ef95..04af87a 100644 --- a/src/list.rs +++ b/src/list.rs @@ -99,6 +99,7 @@ impl List for Users { impl<'a, 'ph, T> Drop for Entries<'a, 'ph, T> { fn drop(&mut self) { let ph = &self.context.ph; + self.valid.set(usize::MAX); unsafe { ph_call!(hexchat_list_free(ph, self.list)); } -- cgit 1.4.1