fix: prevent Widget.msg and EventHandler.msg from being corrupted by thespian.message.send

This commit is contained in:
CJ van den Berg 2025-10-28 21:58:33 +01:00
parent 3e4a604739
commit d6e9cec04d
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 6 additions and 3 deletions

View file

@ -178,7 +178,8 @@ pub fn deinit(self: Self, allocator: Allocator) void {
}
pub fn msg(self: *const Self, m: anytype) error{Exit}!bool {
return self.vtable.send(self.ptr, tp.self_pid(), tp.message.fmt(m));
var buf: [tp.max_message_size]u8 = undefined;
return self.vtable.send(self.ptr, tp.self_pid(), tp.message.fmtbuf(&buf, m) catch |e| std.debug.panic("Widget.msg: {any}", .{e}));
}
pub fn send(self: *const Self, from_: tp.pid_ref, m: tp.message) error{Exit}!bool {