|
|
@@ -132,8 +132,7 @@ pub const Bar = struct { |
| 132 |
132 |
} |
| 133 |
133 |
|
| 134 |
134 |
/// Destroys the bar's X resources and frees the allocation. |
| 135 |
|
- // TODO: Remove `allocator` param as its already stored in `Bar`. |
| 136 |
|
- pub fn destroy(self: *Bar, allocator: std.mem.Allocator, display: *xlib.Display) void { |
|
135 |
+ pub fn destroy(self: *Bar, display: *xlib.Display) void { |
| 137 |
136 |
if (self.xft_draw) |xft_draw| xlib.XftDrawDestroy(xft_draw); |
| 138 |
137 |
if (self.font) |font| xlib.XftFontClose(display, font); |
| 139 |
138 |
|
|
|
@@ -141,7 +140,7 @@ pub const Bar = struct { |
| 141 |
140 |
_ = xlib.XFreePixmap(display, self.pixmap); |
| 142 |
141 |
_ = xlib.c.XDestroyWindow(display, self.window); |
| 143 |
142 |
self.blocks.deinit(self.allocator); |
| 144 |
|
- allocator.destroy(self); |
|
143 |
+ self.allocator.destroy(self); |
| 145 |
144 |
} |
| 146 |
145 |
|
| 147 |
146 |
pub fn add_block(self: *Bar, block: Block) void { |
|
|
@@ -299,11 +298,11 @@ pub fn invalidate_bars(bars: ?*Bar) void { |
| 299 |
298 |
} |
| 300 |
299 |
|
| 301 |
300 |
/// Destroys all bars in the list and frees their resources. |
| 302 |
|
-pub fn destroy_bars(bars: ?*Bar, allocator: std.mem.Allocator, display: *xlib.Display) void { |
|
301 |
+pub fn destroy_bars(bars: ?*Bar, display: *xlib.Display) void { |
| 303 |
302 |
var current = bars; |
| 304 |
303 |
while (current) |bar| { |
| 305 |
304 |
const next = bar.next; |
| 306 |
|
- bar.destroy(allocator, display); |
|
305 |
+ bar.destroy(display); |
| 307 |
306 |
current = next; |
| 308 |
307 |
} |
| 309 |
308 |
} |