Fixed some memory leaks and uses of uninitialized values

This commit is contained in:
Yousef Khadadeh 2025-10-11 15:35:17 +03:00
parent 48156cb4bf
commit 0cc326bcc9
12 changed files with 28 additions and 21 deletions

View file

@ -97,14 +97,6 @@ void MainProgram::update() {
deltaTime.update_time_since();
deltaTime.update_time_point();
toolbar.update();
if(input.key(InputManager::KEY_NOGUI).pressed)
drawGui = !drawGui;
if(input.key(InputManager::KEY_FULLSCREEN).pressed)
input.toggleFullscreen = true;
for(auto& w : worlds) {
if(w == world)
@ -113,6 +105,14 @@ void MainProgram::update() {
w->unfocus_update();
}
toolbar.update(); // GUI should be setup after the world data has been fully updated for this frame, so that the GUI reflects the current state of the world data
if(input.key(InputManager::KEY_NOGUI).pressed)
drawGui = !drawGui;
if(input.key(InputManager::KEY_FULLSCREEN).pressed)
input.toggleFullscreen = true;
NetLibrary::update();
if(tabSetToOpen) {