fix: destroy QueryCache.CacheEntry objects on clean-up
This commit is contained in:
		
							parent
							
								
									d5d7a9bb80
								
							
						
					
					
						commit
						90695e9dc6
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -75,11 +75,13 @@ fn release_ref_unlocked_and_maybe_destroy(self: *Self) void {
 | 
				
			||||||
    while (iter_highlights.next()) |p| {
 | 
					    while (iter_highlights.next()) |p| {
 | 
				
			||||||
        self.allocator.free(p.key_ptr.*);
 | 
					        self.allocator.free(p.key_ptr.*);
 | 
				
			||||||
        if (p.value_ptr.*.query) |q| q.destroy();
 | 
					        if (p.value_ptr.*.query) |q| q.destroy();
 | 
				
			||||||
 | 
					        self.allocator.destroy(p.value_ptr.*);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    var iter_injections = self.injections.iterator();
 | 
					    var iter_injections = self.injections.iterator();
 | 
				
			||||||
    while (iter_injections.next()) |p| {
 | 
					    while (iter_injections.next()) |p| {
 | 
				
			||||||
        self.allocator.free(p.key_ptr.*);
 | 
					        self.allocator.free(p.key_ptr.*);
 | 
				
			||||||
        if (p.value_ptr.*.query) |q| q.destroy();
 | 
					        if (p.value_ptr.*.query) |q| q.destroy();
 | 
				
			||||||
 | 
					        self.allocator.destroy(p.value_ptr.*);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    self.highlights.deinit(self.allocator);
 | 
					    self.highlights.deinit(self.allocator);
 | 
				
			||||||
    self.injections.deinit(self.allocator);
 | 
					    self.injections.deinit(self.allocator);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue