From d9195bff3a6088bb0f116d61fc8c961e3ba4e3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 23 Jun 2013 01:25:05 +0200 Subject: Fix crashes from uninitialized variables, small naming fix for smart pointers --- libmultimc/include/gameupdatetask.h | 8 ++++---- libmultimc/src/gameupdatetask.cpp | 6 +++--- libmultimc/src/minecraftversionlist.cpp | 3 +++ 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'libmultimc') diff --git a/libmultimc/include/gameupdatetask.h b/libmultimc/include/gameupdatetask.h index 63d11113..c3f84356 100644 --- a/libmultimc/include/gameupdatetask.h +++ b/libmultimc/include/gameupdatetask.h @@ -29,7 +29,7 @@ #include "libmmc_config.h" class FileToDownload; -typedef QSharedPointer PtrFileToDownload; +typedef QSharedPointer FileToDownloadPtr; class FileToDownload : public QObject { @@ -49,7 +49,7 @@ class FileToDownload : public QObject private: FileToDownload(const QUrl &url, const QString &path, QObject *parent = 0); public: - static PtrFileToDownload Create(const QUrl &url, const QString &path, QObject *parent = 0); + static FileToDownloadPtr Create(const QUrl &url, const QString &path, QObject *parent = 0); virtual QUrl url() const { return m_dlURL; } virtual void setURL(const QUrl &url) { m_dlURL = url; } @@ -92,7 +92,7 @@ public: virtual void executeTask(); - virtual bool downloadFile(const PtrFileToDownload file); + virtual bool downloadFile(const FileToDownloadPtr file); ////////////////////// @@ -155,7 +155,7 @@ private: //////////////////////// // List of URLs that the game updater will need to download. - QList m_downloadList; + QList m_downloadList; int m_currentDownload; diff --git a/libmultimc/src/gameupdatetask.cpp b/libmultimc/src/gameupdatetask.cpp index 2b2d0ded..114f4ede 100644 --- a/libmultimc/src/gameupdatetask.cpp +++ b/libmultimc/src/gameupdatetask.cpp @@ -111,7 +111,7 @@ void GameUpdateTask::executeTask() emit gameUpdateComplete(m_response); } -bool GameUpdateTask::downloadFile( const PtrFileToDownload file ) +bool GameUpdateTask::downloadFile( const FileToDownloadPtr file ) { setSubStatus("Downloading " + file->url().toString()); QNetworkReply *reply = netMgr->get(QNetworkRequest(file->url())); @@ -231,9 +231,9 @@ void GameUpdateTask::updateDownloadProgress(qint64 current, qint64 total) setProgress((int)(overallDLProgress * 100)); } -PtrFileToDownload FileToDownload::Create(const QUrl &url, const QString &path, QObject *parent) +FileToDownloadPtr FileToDownload::Create(const QUrl &url, const QString &path, QObject *parent) { - return PtrFileToDownload(new FileToDownload (url, path, parent)); + return FileToDownloadPtr(new FileToDownload (url, path, parent)); } FileToDownload::FileToDownload(const QUrl &url, const QString &path, QObject *parent) : diff --git a/libmultimc/src/minecraftversionlist.cpp b/libmultimc/src/minecraftversionlist.cpp index 04c4f918..71deb471 100644 --- a/libmultimc/src/minecraftversionlist.cpp +++ b/libmultimc/src/minecraftversionlist.cpp @@ -160,6 +160,9 @@ MCVListLoadTask::MCVListLoadTask(MinecraftVersionList *vlist) { m_list = vlist; m_currentStable = NULL; + processedAssetsReply = false; + processedMCNReply = false; + processedMCVListReply = false; } MCVListLoadTask::~MCVListLoadTask() -- cgit v1.2.3