From f9dc6ff91347954bb358fa5b987bc76f94c2f331 Mon Sep 17 00:00:00 2001 From: oridbot Date: Tue, 1 Sep 2026 15:56:32 -0400 Subject: [PATCH 1/6] Clear IP address entry after connection attempt --- src/gui/windows/invite.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/windows/invite.zig b/src/gui/windows/invite.zig index b9e6b1a47b..94d4da65c9 100644 --- a/src/gui/windows/invite.zig +++ b/src/gui/windows/invite.zig @@ -50,6 +50,7 @@ fn invite() void { if (err != error.AlreadyConnected) { std.log.err("Cannot connect user: {s}", .{@errorName(err)}); } + ipAddressEntry.clear(); return; }; } From b937f1eafa88fe49dc3802500dbb81170ff342ac Mon Sep 17 00:00:00 2001 From: oridbot Date: Tue, 1 Sep 2026 16:14:15 -0400 Subject: [PATCH 2/6] put it elsewhere --- src/gui/windows/invite.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/windows/invite.zig b/src/gui/windows/invite.zig index 94d4da65c9..9cfa1f4775 100644 --- a/src/gui/windows/invite.zig +++ b/src/gui/windows/invite.zig @@ -42,6 +42,7 @@ fn discoverIpAddressFromNewThread() void { } fn invite() void { + ipAddressEntry.clear(); if (thread) |_thread| { _thread.join(); thread = null; @@ -50,7 +51,6 @@ fn invite() void { if (err != error.AlreadyConnected) { std.log.err("Cannot connect user: {s}", .{@errorName(err)}); } - ipAddressEntry.clear(); return; }; } From 729ee2c00513360ae4fcd8eea0b0532e93ec638d Mon Sep 17 00:00:00 2001 From: oridbot Date: Tue, 1 Sep 2026 17:08:48 -0400 Subject: [PATCH 3/6] move things around --- src/gui/windows/invite.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/windows/invite.zig b/src/gui/windows/invite.zig index 9cfa1f4775..0d234948c7 100644 --- a/src/gui/windows/invite.zig +++ b/src/gui/windows/invite.zig @@ -42,6 +42,7 @@ fn discoverIpAddressFromNewThread() void { } fn invite() void { + ipAddress = ipAddressEntry.currentString.items; ipAddressEntry.clear(); if (thread) |_thread| { _thread.join(); From 2af66e22419d45a6646c4eed83c0ebf0c1c66473 Mon Sep 17 00:00:00 2001 From: oridbot Date: Mon, 7 Sep 2026 19:40:43 -0400 Subject: [PATCH 4/6] make it not pointer --- src/gui/windows/invite.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/windows/invite.zig b/src/gui/windows/invite.zig index 0d234948c7..d9539a4a13 100644 --- a/src/gui/windows/invite.zig +++ b/src/gui/windows/invite.zig @@ -42,13 +42,13 @@ fn discoverIpAddressFromNewThread() void { } fn invite() void { - ipAddress = ipAddressEntry.currentString.items; + const storeIpAddressEntry = ipAddressEntry.currentString; ipAddressEntry.clear(); if (thread) |_thread| { _thread.join(); thread = null; } - _ = main.server.User.init(main.server.connectionManager, ipAddressEntry.currentString.items) catch |err| { + _ = main.server.User.init(main.server.connectionManager, storeIpAddressEntry.items) catch |err| { if (err != error.AlreadyConnected) { std.log.err("Cannot connect user: {s}", .{@errorName(err)}); } From 198c94e1814cac5370ef8abd70278c039fbcd218 Mon Sep 17 00:00:00 2001 From: oridbot Date: Sat, 12 Sep 2026 11:58:30 -0400 Subject: [PATCH 5/6] make it really make memory this time fr fr --- src/gui/windows/invite.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/windows/invite.zig b/src/gui/windows/invite.zig index d9539a4a13..9683710879 100644 --- a/src/gui/windows/invite.zig +++ b/src/gui/windows/invite.zig @@ -42,13 +42,13 @@ fn discoverIpAddressFromNewThread() void { } fn invite() void { - const storeIpAddressEntry = ipAddressEntry.currentString; + const storeIpAddressEntry = main.stackAllocator.dupe(u8, ipAddressEntry.currentString.items); ipAddressEntry.clear(); if (thread) |_thread| { _thread.join(); thread = null; } - _ = main.server.User.init(main.server.connectionManager, storeIpAddressEntry.items) catch |err| { + _ = main.server.User.init(main.server.connectionManager, storeIpAddressEntry) catch |err| { if (err != error.AlreadyConnected) { std.log.err("Cannot connect user: {s}", .{@errorName(err)}); } From 718fe23c0073d1bef1a6358fd6025fcde445794a Mon Sep 17 00:00:00 2001 From: oridbot Date: Sat, 12 Sep 2026 12:36:19 -0400 Subject: [PATCH 6/6] Free da thing in network i really really hope this is right. --- src/network.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network.zig b/src/network.zig index bad585aeb6..4b1517fa49 100644 --- a/src/network.zig +++ b/src/network.zig @@ -1528,6 +1528,7 @@ pub const Connection = struct { // MARK: Connection pub fn init(manager: *ConnectionManager, ipPort: []const u8, user: ?*main.server.User) !*Connection { const result: *Connection = main.globalAllocator.create(Connection); errdefer main.globalAllocator.destroy(result); + defer main.stackAllocator.free(ipPort); result.* = Connection{ .manager = manager, .user = user,