fix: don't leak Buffer.file_path

This commit is contained in:
CJ van den Berg 2025-08-05 15:24:18 +02:00
parent 886a2582a3
commit c88e2dd975
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
5 changed files with 28 additions and 16 deletions

View file

@ -1316,11 +1316,11 @@ fn get_next_mru_buffer(self: *Self) ?[]const u8 {
defer self.allocator.free(buffers);
const active_file_path = self.get_active_file_path();
for (buffers) |buffer| {
if (active_file_path) |fp| if (std.mem.eql(u8, fp, buffer.file_path))
if (active_file_path) |fp| if (std.mem.eql(u8, fp, buffer.get_file_path()))
continue;
if (buffer.hidden)
continue;
return buffer.file_path;
return buffer.get_file_path();
}
return null;
}