File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ pub fn initWithExistingContext(allocator: std.mem.Allocator, ctx: Context) void
7272 zguiSetCurrentContext (ctx );
7373
7474 temp_buffer = std .ArrayList (u8 ){};
75- temp_buffer .? .resize (3 * 1024 + 1 ) catch unreachable ;
75+ temp_buffer .? .resize (mem_allocator .? , 3 * 1024 + 1 ) catch unreachable ;
7676
7777 if (te_enabled ) {
7878 te .init ();
@@ -112,15 +112,16 @@ pub fn deinit() void {
112112 mem_allocator = null ;
113113 }
114114}
115- pub fn initNoContext () void {
115+ pub fn initNoContext (allocator : std.mem.Allocator ) void {
116+ mem_allocator = allocator ;
116117 if (temp_buffer == null ) {
117118 temp_buffer = std .ArrayList (u8 ){};
118- temp_buffer .? .resize (3 * 1024 + 1 ) catch unreachable ;
119+ temp_buffer .? .resize (mem_allocator .? , 3 * 1024 + 1 ) catch unreachable ;
119120 }
120121}
121122pub fn deinitNoContext () void {
122- if (temp_buffer ) | buf | {
123- buf .deinit ();
123+ if (temp_buffer ) | * buf | {
124+ buf .deinit (mem_allocator .? );
124125 }
125126}
126127extern fn zguiCreateContext (shared_font_atlas : ? * const anyopaque ) Context ;
You can’t perform that action at this time.
0 commit comments