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.
This commit is contained in:
parent
0e4d082361
commit
2b3bba512e
|
@ -146,6 +146,7 @@ CameraManager::~CameraManager()
|
|||
// save settings here?
|
||||
|
||||
delete[] frameBuffer;
|
||||
delete[] tempFrameBuffer;
|
||||
}
|
||||
|
||||
void CameraManager::init()
|
||||
|
|
|
@ -311,8 +311,8 @@ void DeInit()
|
|||
MPQueue->detach();
|
||||
}
|
||||
|
||||
MPQueue = nullptr;
|
||||
delete MPQueue;
|
||||
MPQueue = nullptr;
|
||||
}
|
||||
|
||||
void SetRecvTimeout(int timeout)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue