aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl/main.cpp
diff options
context:
space:
mode:
authorRayyan Ansari <rayyan@ansari.sh>2023-11-06 20:17:06 +0000
committerRayyan Ansari <rayyan@ansari.sh>2023-11-06 20:25:32 +0000
commit2b3bba512eed4df6a477b7abdf548e13e4fe0078 (patch)
tree862bd3b6359f85b9f5d18c209a23a90ecdc280d7 /src/frontend/qt_sdl/main.cpp
parent0e4d0823617240345cc8ac5f3703636d041c2df3 (diff)
Fix some memory leaks
Free some objects that were allocated with new but not deleted, and in one case, do not set a pointer to nullptr before deleting, as this results in a memory leak due to memory allocated not being freed.
Diffstat (limited to 'src/frontend/qt_sdl/main.cpp')
-rw-r--r--src/frontend/qt_sdl/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp
index e96bb4b..f033e66 100644
--- a/src/frontend/qt_sdl/main.cpp
+++ b/src/frontend/qt_sdl/main.cpp
@@ -832,6 +832,7 @@ ScreenHandler::ScreenHandler(QWidget* widget)
ScreenHandler::~ScreenHandler()
{
mouseTimer->stop();
+ delete mouseTimer;
}
void ScreenHandler::screenSetupLayout(int w, int h)
@@ -1872,6 +1873,8 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
MainWindow::~MainWindow()
{
+ delete[] actScreenAspectTop;
+ delete[] actScreenAspectBot;
}
void MainWindow::closeEvent(QCloseEvent* event)
@@ -3376,6 +3379,8 @@ int main(int argc, char** argv)
int ret = melon.exec();
+ delete options;
+
emuThread->emuStop();
emuThread->wait();
delete emuThread;