Skip to content

Commit 5bcdcad

Browse files
foxnneemidoots
authored andcommitted
core: Windows needed heap-allocated context
1 parent 06aec42 commit 5bcdcad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/Windows.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,10 @@ fn initWindow(
234234
.from_windows_hwnd = &native.surface_descriptor_from_hwnd,
235235
} };
236236

237-
const context: Context = .{ .core = core, .window_id = window_id };
237+
const context = try core.allocator.create(Context);
238+
context.* = .{ .core = core, .window_id = window_id };
238239

239-
_ = w.SetWindowLongPtrW(native_window, w.GWLP_USERDATA, @bitCast(@intFromPtr(&context)));
240+
_ = w.SetWindowLongPtrW(native_window, w.GWLP_USERDATA, @bitCast(@intFromPtr(context)));
240241

241242
restoreWindowPosition(core, window_id);
242243

0 commit comments

Comments
 (0)