From 30394c16ccdcdb145352e245a7a8893cef28e82d Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 17 Oct 2023 20:37:19 +0200 Subject: fix(engine): drop objects before window to call valid GL functions --- engine/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engine/src') diff --git a/engine/src/lib.rs b/engine/src/lib.rs index 9d836c0..db6ab94 100644 --- a/engine/src/lib.rs +++ b/engine/src/lib.rs @@ -20,8 +20,9 @@ pub use glfw::WindowSize; #[derive(Debug)] pub struct Engine { - window: Window, + /// Objects have to be dropped before window. Otherwise, UB. objects: BTreeMap, + window: Window, } impl Engine -- cgit v1.2.3-18-g5258