fix: destroy QueryCache.CacheEntry objects on clean-up

This commit is contained in:
CJ van den Berg 2025-03-19 15:32:40 +01:00
parent 80ceadcff9
commit 56f33e51a6

View file

@ -75,11 +75,13 @@ fn release_ref_unlocked_and_maybe_destroy(self: *Self) void {
while (iter_highlights.next()) |p| {
self.allocator.free(p.key_ptr.*);
if (p.value_ptr.*.query) |q| q.destroy();
self.allocator.destroy(p.value_ptr.*);
}
var iter_injections = self.injections.iterator();
while (iter_injections.next()) |p| {
self.allocator.free(p.key_ptr.*);
if (p.value_ptr.*.query) |q| q.destroy();
self.allocator.destroy(p.value_ptr.*);
}
self.highlights.deinit(self.allocator);
self.injections.deinit(self.allocator);