From 667eb6bab5654529d4da638a4249969f87077578 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 8 Mar 2022 21:01:36 +0300 Subject: [PATCH] Added Events::finalize --- src/voxel_engine.cpp | 1 + src/window/Events.cpp | 5 +++++ src/window/Events.h | 1 + 3 files changed, 7 insertions(+) diff --git a/src/voxel_engine.cpp b/src/voxel_engine.cpp index d03b9e7b..dfb7dc3c 100644 --- a/src/voxel_engine.cpp +++ b/src/voxel_engine.cpp @@ -330,6 +330,7 @@ int main() { delete assets; finalize_renderer(); + Events::finalize(); Window::terminate(); return 0; } diff --git a/src/window/Events.cpp b/src/window/Events.cpp index 6e323f1c..18d0e0b0 100644 --- a/src/window/Events.cpp +++ b/src/window/Events.cpp @@ -70,6 +70,11 @@ int Events::initialize(){ return 0; } +void Events::finalize(){ + delete[] _keys; + delete[] _frames; +} + bool Events::pressed(int keycode){ if (keycode < 0 || keycode >= _MOUSE_BUTTONS) return false; diff --git a/src/window/Events.h b/src/window/Events.h index 414a06bc..996d4a03 100644 --- a/src/window/Events.h +++ b/src/window/Events.h @@ -18,6 +18,7 @@ public: static bool _cursor_started; static int initialize(); + static void finalize(); static void pullEvents(); static bool pressed(int keycode);