mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 19:57:45 +00:00
Fix more leaked memory due to QObject parents not being set
This commit is contained in:
parent
da99c09706
commit
66f65784a8
8 changed files with 9 additions and 16 deletions
|
@ -126,7 +126,6 @@ class LauncherCore : public QObject {
|
|||
Q_PROPERTY(SquareBoot* squareBoot MEMBER squareBoot)
|
||||
public:
|
||||
LauncherCore();
|
||||
~LauncherCore();
|
||||
|
||||
// used for qml only, TODO: move this to a dedicated factory
|
||||
Q_INVOKABLE LoginInformation* createNewLoginInfo() {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
class Watchdog : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
Watchdog(LauncherCore& core) : core(core) {}
|
||||
Watchdog(LauncherCore& core) : core(core), QObject(&core) {}
|
||||
|
||||
void launchGame(const ProfileSettings& settings, LoginAuth auth);
|
||||
|
||||
|
|
|
@ -479,7 +479,7 @@ void LauncherCore::readWineInfo(ProfileSettings& profile) {
|
|||
#endif
|
||||
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
|
||||
auto wineProcess = new QProcess();
|
||||
auto wineProcess = new QProcess(this);
|
||||
wineProcess->setProcessChannelMode(QProcess::MergedChannels);
|
||||
|
||||
connect(wineProcess, &QProcess::readyRead, this, [wineProcess, &profile] {
|
||||
|
@ -543,12 +543,6 @@ LauncherCore::LauncherCore() : settings(QSettings::IniFormat, QSettings::UserSco
|
|||
readInitialInformation();
|
||||
}
|
||||
|
||||
LauncherCore::~LauncherCore() noexcept {
|
||||
#ifdef ENABLE_WATCHDOG
|
||||
delete watchdog;
|
||||
#endif
|
||||
}
|
||||
|
||||
ProfileSettings& LauncherCore::getProfile(int index) {
|
||||
return *profileSettings[index];
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <QMessageBox>
|
||||
#include <QNetworkReply>
|
||||
|
||||
SapphireLauncher::SapphireLauncher(LauncherCore& window) : window(window) {
|
||||
SapphireLauncher::SapphireLauncher(LauncherCore& window) : window(window), QObject(&window) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include "squarelauncher.h"
|
||||
|
||||
SquareBoot::SquareBoot(LauncherCore& window, SquareLauncher& launcher) : window(window), launcher(launcher) {
|
||||
SquareBoot::SquareBoot(LauncherCore& window, SquareLauncher& launcher) : window(window), launcher(launcher), QObject(&window) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "watchdog.h"
|
||||
#endif
|
||||
|
||||
SquareLauncher::SquareLauncher(LauncherCore& window) : window(window) {
|
||||
SquareLauncher::SquareLauncher(LauncherCore& window) : window(window), QObject(&window) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ QMap<DalamudChannel, QString> channelToDistribPrefix = {
|
|||
{DalamudChannel::Net5, "net5/"}
|
||||
};
|
||||
|
||||
AssetUpdater::AssetUpdater(LauncherCore& launcher) : launcher(launcher) {
|
||||
AssetUpdater::AssetUpdater(LauncherCore& launcher) : launcher(launcher), QObject(&launcher) {
|
||||
launcher.mgr->setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
|
||||
|
||||
dataDir =
|
||||
|
|
|
@ -49,7 +49,7 @@ int main(int argc, char* argv[]) {
|
|||
QCommandLineOption cliOption("cli", "Don't open a main window, and use the cli interface.");
|
||||
parser.addOption(cliOption);
|
||||
|
||||
auto cmd = new CMDInterface(parser);
|
||||
auto cmd = std::make_unique<CMDInterface>(parser);
|
||||
|
||||
parser.process(app);
|
||||
|
||||
|
@ -63,12 +63,12 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
LauncherCore c;
|
||||
if(parser.isSet(tabletOption)) {
|
||||
new TabletInterface(c);
|
||||
std::make_unique<TabletInterface>(c);
|
||||
} else if(parser.isSet(cliOption)) {
|
||||
if(!cmd->parse(parser, c))
|
||||
return -1;
|
||||
} else {
|
||||
new DesktopInterface(c);
|
||||
std::make_unique<DesktopInterface>(c);
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
|
|
Loading…
Add table
Reference in a new issue