summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-08-19 09:04:58 +0200
committerPetr Mrázek <peterix@gmail.com>2016-08-19 09:04:58 +0200
commiteb747e08b78d8630413b9bdb3a96108ccfcc2ac8 (patch)
treec6edecbc9c79e08dcb03d0248f2840a057fc8d24 /api
parent67eca08b2260f19ff296c0b6cb73eb3b0479e4b2 (diff)
downloadMultiMC-eb747e08b78d8630413b9bdb3a96108ccfcc2ac8.tar
MultiMC-eb747e08b78d8630413b9bdb3a96108ccfcc2ac8.tar.gz
MultiMC-eb747e08b78d8630413b9bdb3a96108ccfcc2ac8.tar.lz
MultiMC-eb747e08b78d8630413b9bdb3a96108ccfcc2ac8.tar.xz
MultiMC-eb747e08b78d8630413b9bdb3a96108ccfcc2ac8.zip
NOISSUE fix minor memory leaks
Diffstat (limited to 'api')
-rw-r--r--api/logic/minecraft/MinecraftProfile.cpp8
-rw-r--r--api/logic/minecraft/MinecraftProfile.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/api/logic/minecraft/MinecraftProfile.cpp b/api/logic/minecraft/MinecraftProfile.cpp
index 19127a54..fbd67875 100644
--- a/api/logic/minecraft/MinecraftProfile.cpp
+++ b/api/logic/minecraft/MinecraftProfile.cpp
@@ -33,6 +33,14 @@ MinecraftProfile::MinecraftProfile(ProfileStrategy *strategy)
clear();
}
+MinecraftProfile::~MinecraftProfile()
+{
+ if(m_strategy)
+ {
+ delete m_strategy;
+ }
+}
+
void MinecraftProfile::setStrategy(ProfileStrategy* strategy)
{
Q_ASSERT(strategy != nullptr);
diff --git a/api/logic/minecraft/MinecraftProfile.h b/api/logic/minecraft/MinecraftProfile.h
index cc9b89b1..22dca979 100644
--- a/api/logic/minecraft/MinecraftProfile.h
+++ b/api/logic/minecraft/MinecraftProfile.h
@@ -38,6 +38,7 @@ class MULTIMC_LOGIC_EXPORT MinecraftProfile : public QAbstractListModel
public:
explicit MinecraftProfile(ProfileStrategy *strategy);
+ virtual ~MinecraftProfile();
void setStrategy(ProfileStrategy * strategy);
ProfileStrategy *strategy();