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);