fix: make sure project state is freed with the correct allocator

This commit is contained in:
CJ van den Berg 2025-11-26 15:55:47 +01:00
parent 20129ea773
commit c8840f0756
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 7 additions and 4 deletions

View file

@ -403,7 +403,9 @@ const cmds = struct {
try self.write_state(&state_writer.writer);
try state_writer.writer.flush();
const old_project = tp.env.get().str("project");
try project_manager.store_state(old_project, try state_writer.toOwnedSlice());
var state_al = state_writer.toArrayList();
const state = state_al.toManaged(self.allocator);
try project_manager.store_state(old_project, state);
}
const project_state = try project_manager.open(project_dir);