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

@@ -15,23 +15,15 @@ class EmuThread : public QThread
std::unique_ptr<Vulkan::WSIPlatform> wsiPlatform;
std::unique_ptr<ParallelRDP::WindowInfo> windowInfo;
public:
explicit EmuThread(std::unique_ptr<QtInstanceFactory>&& instance, std::unique_ptr<Vulkan::WSIPlatform>&& wsiPlatform, std::unique_ptr<ParallelRDP::WindowInfo>&& windowInfo, QObject* parent_object) noexcept;
~EmuThread() {
delete core;
delete settings;
}
explicit EmuThread(std::unique_ptr<QtInstanceFactory>&& instance, std::unique_ptr<Vulkan::WSIPlatform>&& wsiPlatform, std::unique_ptr<ParallelRDP::WindowInfo>&& windowInfo, SettingsWindow&) noexcept;
[[noreturn]] void run() noexcept override;
ParallelRDP parallel;
n64::Core* core;
SettingsWindow* settings;
n64::Core core;
SettingsWindow& settings;
bool running = false;
bool LoadTAS(const fs::path& path) {
return core->LoadTAS(path);
}
void TogglePause()
{
running = !running;
@@ -40,15 +32,15 @@ public:
void Reset()
{
running = false;
core->Stop();
core->LoadROM(core->rom);
core.Stop();
core.LoadROM(core.rom);
running = true;
}
void Stop()
{
core->rom = {};
core.rom = {};
running = false;
core->Stop();
core.Stop();
}
};