From 5bcdcadb744ae3c02f2a282117602c8f13f05075 Mon Sep 17 00:00:00 2001 From: foxnne Date: Sun, 1 Dec 2024 13:26:35 -0600 Subject: [PATCH] core: Windows needed heap-allocated context --- src/core/Windows.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/Windows.zig b/src/core/Windows.zig index 0db0bdfe..f69d6810 100644 --- a/src/core/Windows.zig +++ b/src/core/Windows.zig @@ -234,9 +234,10 @@ fn initWindow( .from_windows_hwnd = &native.surface_descriptor_from_hwnd, } }; - const context: Context = .{ .core = core, .window_id = window_id }; + const context = try core.allocator.create(Context); + context.* = .{ .core = core, .window_id = window_id }; - _ = w.SetWindowLongPtrW(native_window, w.GWLP_USERDATA, @bitCast(@intFromPtr(&context))); + _ = w.SetWindowLongPtrW(native_window, w.GWLP_USERDATA, @bitCast(@intFromPtr(context))); restoreWindowPosition(core, window_id);