diff --git a/zig-impl/src/context.zig b/zig-impl/src/context.zig index 4e550ae..a3690af 100644 --- a/zig-impl/src/context.zig +++ b/zig-impl/src/context.zig @@ -464,11 +464,9 @@ pub const Context = struct { // SWITCHED = write message for its switch buddy (callbacks) if (self.connections.items[i].t == .SWITCHED) { current_event = self.switchdb.handle_event_write (i, m); - // TODO: remove the message from the tx array. // Message inner memory is already freed. switch (current_event.t) { .SWITCH_TX => { - try self.schedule(current_event.m.?); }, .ERROR => { var dest = try self.switchdb.getDest(fd.fd); diff --git a/zig-impl/src/ipcd.zig b/zig-impl/src/ipcd.zig index f328d0b..3bdce2f 100644 --- a/zig-impl/src/ipcd.zig +++ b/zig-impl/src/ipcd.zig @@ -175,6 +175,7 @@ fn create_service() !void { try ctx.write(message); var response_from_service = try ctx.read_fd(servicefd); if (response_from_service) |r| { + defer r.deinit(); if (std.mem.eql(u8, r.payload, "ok")) { // OK print("service has established the connection\n", .{}); diff --git a/zig-impl/src/switch.zig b/zig-impl/src/switch.zig index 6376de6..0ade669 100644 --- a/zig-impl/src/switch.zig +++ b/zig-impl/src/switch.zig @@ -289,6 +289,5 @@ fn default_out (origin: i32, m: *const Message) CBEventType { // returning basic errors, no details. _ = m.write(writer) catch return CBEventType.ERROR; _ = stream.write (fbs.getWritten()) catch return CBEventType.ERROR; - return CBEventType.NO_ERROR; }