fix(kqueue): another unlocked snapshots usage
This commit is contained in:
parent
94e150a522
commit
9d58c9b701
1 changed files with 4 additions and 1 deletions
|
|
@ -358,7 +358,10 @@ pub fn remove_watch(self: *@This(), allocator: std.mem.Allocator, path: []const
|
||||||
std.posix.close(entry.value.fd);
|
std.posix.close(entry.value.fd);
|
||||||
allocator.free(entry.key);
|
allocator.free(entry.key);
|
||||||
}
|
}
|
||||||
if (self.snapshots.fetchRemove(path)) |entry| {
|
self.snapshots_mutex.lock();
|
||||||
|
const snap_entry = self.snapshots.fetchRemove(path);
|
||||||
|
self.snapshots_mutex.unlock();
|
||||||
|
if (snap_entry) |entry| {
|
||||||
var snap = entry.value;
|
var snap = entry.value;
|
||||||
var it = snap.iterator();
|
var it = snap.iterator();
|
||||||
while (it.next()) |ne| allocator.free(ne.key_ptr.*);
|
while (it.next()) |ne| allocator.free(ne.key_ptr.*);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue