Changes
7 changed files (+17/-12)
-
-
@@ -80,13 +80,13 @@ .version = version,}; } pub fn deinit(self: @This()) void { pub fn deinit(self: *const @This()) void { self.allocator.free(self.version); self.allocator.free(self.name); self.allocator.free(self.id); } pub fn getKey(self: @This()) []const u8 { pub fn getKey(self: *const @This()) []const u8 { return self.id; } };
-
@@ -105,7 +105,7 @@ .capi_lock = std.Thread.Mutex{},}; } pub fn deinit(self: *App) void { pub fn deinit(self: *const App) void { self.on_connection_change.deinit(); self.on_server_change.deinit(); }
-
@@ -169,6 +169,7 @@ allocator.destroy(self.server_selector);self.internal.deinit(); allocator.destroy(self.internal); self.internal = undefined; } pub fn destroy(self_ptr: ?*CApi) callconv(.C) void {
-
-
-
@@ -48,7 +48,7 @@ .on_zone_list_loading_change = OnZoneListLoadingChange.Store.init(allocator),}; } pub fn deinit(self: *Self) void { pub fn deinit(self: *const Self) void { self.on_zone_add.deinit(); self.on_zone_list_loading_change.deinit(); }
-
@@ -133,6 +133,7 @@ self.internal.allocator.free(self.name[0..self.name_len]);self.internal.allocator.free(self.id[0..self.id_len]); self.internal.deinit(); self.internal.allocator.destroy(self.internal); self.internal = undefined; } pub fn loadZones(capi_ptr: ?*CApi) callconv(.C) void {
-
@@ -179,7 +180,7 @@ for (res.value.zones, 0..) |zone, i| {const dst = try self.internal.allocator.create(Zone.CApi); errdefer self.internal.allocator.destroy(dst); dst.* = try Zone.CApi.init(self.internal.allocator, zone); dst.* = try Zone.CApi.init(self.internal.allocator, &zone); zones[i] = dst; }
-
-
-
@@ -36,7 +36,7 @@ .on_delete_callbacks = OnDelete.Store.init(allocator),}; } pub fn deinit(self: *Self) void { pub fn deinit(self: *const Self) void { self.on_change_callbacks.deinit(); self.on_delete_callbacks.deinit(); }
-
@@ -55,7 +55,7 @@ paused = 1,playing = 2, }; pub fn init(allocator: std.mem.Allocator, zone: Transport.Zone) std.mem.Allocator.Error!CApi { pub fn init(allocator: std.mem.Allocator, zone: *const Transport.Zone) std.mem.Allocator.Error!CApi { const internal = try allocator.create(Self); errdefer allocator.destroy(internal); internal.* = Self.init(allocator);
-
@@ -86,6 +86,7 @@ allocator.free(self.id[0..self.id_len]);allocator.free(self.name[0..self.name_len]); self.internal.deinit(); allocator.destroy(self.internal); self.internal = undefined; } pub fn onChange(capi_ptr: ?*CApi, cb: OnChange.Fn, userdata: callback.UserData) callconv(.C) void {
-
-
-
@@ -43,7 +43,7 @@ .capi_lock = std.Thread.Mutex{},}; } pub fn deinit(self: *Self) void { pub fn deinit(self: *const Self) void { self.on_change_callbacks.deinit(); }
-
@@ -84,6 +84,7 @@ self.deinitEntries();self.internal.deinit(); allocator.destroy(self.internal); self.internal = undefined; } inline fn deinitEntries(self: *CApi) void {
-
-
-
@@ -41,11 +41,12 @@ /// Free-format version string.version: [*:0]const u8, version_len: usize, pub fn deinit(self: CApi) void { pub fn deinit(self: *CApi) void { self.internal.allocator.free(self.id[0..self.id_len]); self.internal.allocator.free(self.name[0..self.name_len]); self.internal.allocator.free(self.version[0..self.version_len]); self.internal.allocator.destroy(self.internal); self.internal = undefined; } pub const FromSoodResponseError = std.mem.Allocator.Error;
-
-
-
@@ -41,7 +41,7 @@ pub fn init(allocator: std.mem.Allocator) Store {return .{ .cbs = std.ArrayList(Self).init(allocator) }; } pub fn deinit(self: *Store) void { pub fn deinit(self: *const Store) void { self.cbs.deinit(); }
-
-
-
@@ -128,12 +128,12 @@ // Non-SOOD message. Unlikely but technically possible.continue; }; const stale = servers.get(response.unique_id); const stale = servers.getPtr(response.unique_id); defer if (stale) |server| { server.deinit(); }; const server = try Server.fromSoodResponse(allocator, src, &response); var server = try Server.fromSoodResponse(allocator, src, &response); errdefer server.deinit(); try servers.put(server.getKey(), server); }
-