We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fa8081 commit d90f353Copy full SHA for d90f353
src/gui.zig
@@ -112,15 +112,16 @@ pub fn deinit() void {
112
mem_allocator = null;
113
}
114
115
-pub fn initNoContext() void {
+pub fn initNoContext(allocator: std.mem.Allocator) void {
116
+ mem_allocator = allocator;
117
if (temp_buffer == null) {
118
temp_buffer = std.ArrayList(u8){};
- temp_buffer.?.resize(3 * 1024 + 1) catch unreachable;
119
+ temp_buffer.?.resize(mem_allocator.?, 3 * 1024 + 1) catch unreachable;
120
121
122
pub fn deinitNoContext() void {
- if (temp_buffer) |buf| {
123
- buf.deinit();
+ if (temp_buffer) |*buf| {
124
+ buf.deinit(mem_allocator.?);
125
126
127
extern fn zguiCreateContext(shared_font_atlas: ?*const anyopaque) Context;
0 commit comments