Update Server.zig
This commit is contained in:
parent
2c5ae262f7
commit
4d0ab8b1aa
@ -2442,7 +2442,7 @@ pub fn processJsonRpc(server: *Server, writer: anytype, json: []const u8) !void
|
|||||||
[]const u8 => switch (value) {
|
[]const u8 => switch (value) {
|
||||||
.String => |s| blk: {
|
.String => |s| blk: {
|
||||||
var nv = try server.allocator.dupe(u8, s);
|
var nv = try server.allocator.dupe(u8, s);
|
||||||
server.allocator.free(@field(server.config, field.name).?);
|
if (@field(server.config, field.name)) |prev_val| server.allocator.free(prev_val);
|
||||||
break :blk nv;
|
break :blk nv;
|
||||||
}, // TODO: Allocation model? (same with didChangeConfiguration); imo this isn't *that* bad but still
|
}, // TODO: Allocation model? (same with didChangeConfiguration); imo this isn't *that* bad but still
|
||||||
else => @panic("Invalid configuration value"), // TODO: Handle this
|
else => @panic("Invalid configuration value"), // TODO: Handle this
|
||||||
|
Loading…
Reference in New Issue
Block a user