Changes
1 changed files (+21/-5)
-
-
@@ -439,14 +439,21 @@ pub const Connection = extern struct {.server = server.retain(), .host = host, .saved_token = saved_token, .browse_listeners = std.AutoHashMap(u64, BrowseListener).init(allocator), .load_listeners = std.AutoHashMap(u64, LoadListener).init(allocator), .image_downloads = std.AutoHashMap(u64, *ImageDownload).init(allocator), .control_events = std.AutoHashMap(u64, ControlListener).init(allocator), .browse_listeners = undefined, .load_listeners = undefined, .image_downloads = undefined, .control_events = undefined, }; } fn deinit(self: *Internal) void { fn initListeners(self: *Internal) void { self.browse_listeners = std.AutoHashMap(u64, BrowseListener).init(allocator); self.load_listeners = std.AutoHashMap(u64, LoadListener).init(allocator); self.image_downloads = std.AutoHashMap(u64, *ImageDownload).init(allocator); self.control_events = std.AutoHashMap(u64, ControlListener).init(allocator); } fn deinitListeners(self: *Internal) void { self.browse_listeners.deinit(); self.load_listeners.deinit();
-
@@ -456,6 +463,10 @@ pub const Connection = extern struct {} self.image_downloads.deinit(); self.control_events.deinit(); } fn deinit(self: *Internal) void { self.deinitListeners(); if (self.ws) |*ws| { ws.deinit();
-
@@ -544,6 +555,8 @@ pub const Connection = extern struct {ws.deinit(); self.internal.ws = null; } self.internal.deinitListeners(); } pub fn getEvent(ptr: ?*Connection) callconv(.C) ?*Event {
-
@@ -749,6 +762,9 @@ pub const Connection = extern struct {.{self.internal.server.internal.address}, ); self.internal.initListeners(); errdefer self.internal.deinitListeners(); var ws = try websocket.Client.init(allocator, .{ .host = self.internal.host, .port = self.internal.server.internal.address.getPort(),
-