Reduce memory leaks maybe?

This commit is contained in:
SimoneN64
2024-05-14 23:11:17 +02:00
parent 40cee365a9
commit 0641cedd3d
8 changed files with 91 additions and 122 deletions

View File

@@ -3,21 +3,21 @@
#include <ParallelRDPWrapper.hpp>
#include "Audio.hpp"
EmuThread::EmuThread(std::unique_ptr<QtInstanceFactory>&& instance_, std::unique_ptr<Vulkan::WSIPlatform>&& wsiPlatform_, std::unique_ptr<ParallelRDP::WindowInfo>&& windowInfo_, QObject* parent_object) noexcept
: QThread(parent_object), instance(std::move(instance_)), wsiPlatform(std::move(wsiPlatform_)), windowInfo(std::move(windowInfo_)) {}
EmuThread::EmuThread(std::unique_ptr<QtInstanceFactory>&& instance_, std::unique_ptr<Vulkan::WSIPlatform>&& wsiPlatform_, std::unique_ptr<ParallelRDP::WindowInfo>&& windowInfo_, SettingsWindow& settings) noexcept
: instance(std::move(instance_)), wsiPlatform(std::move(wsiPlatform_)), windowInfo(std::move(windowInfo_)), core(parallel), settings(settings) {}
[[noreturn]] void EmuThread::run() noexcept {
parallel.Init(instance.get(), std::move(wsiPlatform), std::move(windowInfo), core->cpu->GetMem().GetRDRAMPtr());
parallel.Init(instance.get(), std::move(wsiPlatform), std::move(windowInfo), core.cpu->GetMem().GetRDRAMPtr());
while (true) {
if (!core->pause) {
core->Run(settings->getVolumeL(), settings->getVolumeR());
if(core->render) {
parallel.UpdateScreen(core->cpu->GetMem().mmio.vi);
if (!core.pause) {
core.Run(settings.getVolumeL(), settings.getVolumeR());
if(core.render) {
parallel.UpdateScreen(core.cpu->GetMem().mmio.vi);
}
} else {
if(core->render) {
parallel.UpdateScreen(core->cpu->GetMem().mmio.vi, true);
if(core.render) {
parallel.UpdateScreen(core.cpu->GetMem().mmio.vi, true);
}
}
}