File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ pub fn main() !void {
4747 // See https://github.com/ziglang/zig/issues/19072
4848 try delve .init (std .heap .c_allocator );
4949 } else {
50- try delve .init (gpa .allocator ());
50+ // Using the default allocator will let us detect memory leaks
51+ try delve .init (delve .mem .createDefaultAllocator ());
5152 }
5253
5354 try registerModule ();
@@ -94,6 +95,7 @@ fn on_init() !void {
9495 // Create a material out of our shader and textures
9596 material = try delve .platform .graphics .Material .init (.{
9697 .shader = shader .? ,
98+ .own_shader = true ,
9799 .texture_0 = tex_base ,
98100 .texture_1 = delve .platform .graphics .createSolidTexture (0x00000000 ),
99101
@@ -176,6 +178,7 @@ fn on_draw() void {
176178fn on_cleanup () ! void {
177179 debug .log ("Skinned mesh example module cleaning up" , .{});
178180
181+ material .deinit ();
179182 animation .deinit ();
180183 mesh_test .deinit ();
181184}
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ pub fn main() !void {
4444 // See https://github.com/ziglang/zig/issues/19072
4545 try delve .init (std .heap .c_allocator );
4646 } else {
47+ // Using the default allocator will let us detect memory leaks
4748 try delve .init (delve .mem .createDefaultAllocator ());
4849 }
4950
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ pub fn main() !void {
2828 // See https://github.com/ziglang/zig/issues/19072
2929 try delve .init (std .heap .c_allocator );
3030 } else {
31- try delve .init (gpa .allocator ());
31+ // Using the default allocator will let us detect memory leaks
32+ try delve .init (delve .mem .createDefaultAllocator ());
3233 }
3334
3435 try fps_module .registerModule ();
You can’t perform that action at this time.
0 commit comments