fix memory leak and add example bare metal installer

This commit is contained in:
2026-03-08 05:40:52 -04:00
parent db11468d93
commit 2279ea063e
2 changed files with 76 additions and 1 deletions

View File

@@ -207,7 +207,7 @@ server_start :: proc(server: ^Server) -> bool {
// Spawn a new thread for this connection
t := thread.create(connection_worker_thread)
if t != nil {
t.init_context = context
//t.init_context = context // We dont actually need need to share the main threads context
t.data = conn_data
thread.start(t)
} else {
@@ -272,6 +272,9 @@ handle_connection :: proc(server: ^Server, conn: net.TCP_Socket, source: net.End
context.allocator = request_alloc
defer context.allocator = old
// Reset the temp allocator each request
defer free_all(context.temp_allocator)
request, parse_err := parse_request(conn, request_alloc, server.config)
// Handle parse errors