Also free the sane text when releasing a document

This commit is contained in:
Alexandros Naskos 2020-05-07 20:02:54 +03:00
parent 6ac068a3c5
commit 6ed45a1f23

View File

@ -85,6 +85,9 @@ pub fn openDocument(uri: []const u8, text: []const u8) !void {
try log("Opened already open file: {}", .{uri});
allocator.free(existing_entry.key);
allocator.free(existing_entry.value.mem);
if (existing_entry.value.sane_text) |str| {
allocator.free(str);
}
}
}