|
From: <cn...@us...> - 2023-06-30 03:04:08
|
Revision: 1403
http://sourceforge.net/p/seq/svn/1403
Author: cn187
Date: 2023-06-30 03:04:04 +0000 (Fri, 30 Jun 2023)
Log Message:
-----------
Mem leak fixes
Modified Paths:
--------------
showeq/trunk/src/experiencelog.cpp
showeq/trunk/src/packetinfo.cpp
showeq/trunk/src/packetinfo.h
showeq/trunk/src/xmlpreferences.cpp
Modified: showeq/trunk/src/experiencelog.cpp
===================================================================
--- showeq/trunk/src/experiencelog.cpp 2023-06-30 03:02:24 UTC (rev 1402)
+++ showeq/trunk/src/experiencelog.cpp 2023-06-30 03:04:04 UTC (rev 1403)
@@ -155,6 +155,14 @@
qDeleteAll(m_exp_list);
m_exp_list.clear();
+
+ if (m_ZEM_menu)
+ delete m_ZEM_menu;
+ if (m_view_menu)
+ delete m_view_menu;
+ if (m_exp_rate_menu)
+ delete m_exp_rate_menu;
+
}
ExperienceWindow::ExperienceWindow(const DataLocationMgr* dataLocMgr,
Modified: showeq/trunk/src/packetinfo.cpp
===================================================================
--- showeq/trunk/src/packetinfo.cpp 2023-06-30 03:02:24 UTC (rev 1402)
+++ showeq/trunk/src/packetinfo.cpp 2023-06-30 03:04:04 UTC (rev 1403)
@@ -522,8 +522,13 @@
// if found, remove it from the opcodes table
if (opcode)
- return m_opcodes.remove(opcode->opcode());
+ {
+ m_opcodes.remove(opcode->opcode());
+ delete opcode;
+ return true;
+ }
+
return false;
}
Modified: showeq/trunk/src/packetinfo.h
===================================================================
--- showeq/trunk/src/packetinfo.h 2023-06-30 03:02:24 UTC (rev 1402)
+++ showeq/trunk/src/packetinfo.h 2023-06-30 03:04:04 UTC (rev 1403)
@@ -291,8 +291,9 @@
inline void EQPacketOPCodeDB::clear(void)
{
+ qDeleteAll(m_opcodes);
+ m_opcodes.clear();
m_opcodesByName.clear();
- m_opcodes.clear();
}
inline EQPacketOPCode* EQPacketOPCodeDB::edit(uint16_t opcode)
Modified: showeq/trunk/src/xmlpreferences.cpp
===================================================================
--- showeq/trunk/src/xmlpreferences.cpp 2023-06-30 03:02:24 UTC (rev 1402)
+++ showeq/trunk/src/xmlpreferences.cpp 2023-06-30 03:04:04 UTC (rev 1403)
@@ -75,10 +75,27 @@
XMLPreferences::~XMLPreferences()
{
+ for (PrefSectionDict::iterator it = m_userSections.begin(); it != m_userSections.end(); ++it)
+ {
+ qDeleteAll(**it);
+ (*it)->clear();
+ }
qDeleteAll(m_userSections);
m_userSections.clear();
+
+ for (PrefSectionDict::iterator it = m_defaultsSections.begin(); it != m_defaultsSections.end(); ++it)
+ {
+ qDeleteAll(**it);
+ (*it)->clear();
+ }
qDeleteAll(m_defaultsSections);
m_defaultsSections.clear();
+
+ for (CommentSectionDict::iterator it = m_commentSections.begin(); it != m_commentSections.end(); ++it)
+ {
+ qDeleteAll(**it);
+ (*it)->clear();
+ }
qDeleteAll(m_commentSections);
m_commentSections.clear();
}
@@ -106,13 +123,24 @@
void XMLPreferences::revert()
{
// clear out all default preferecnes
+ for (PrefSectionDict::iterator it = m_defaultsSections.begin(); it != m_defaultsSections.end(); ++it)
+ {
+ qDeleteAll(**it);
+ (*it)->clear();
+ }
qDeleteAll(m_defaultsSections);
m_defaultsSections.clear();
// clear out all user preferences
+ for (PrefSectionDict::iterator it = m_userSections.begin(); it != m_userSections.end(); ++it)
+ {
+ qDeleteAll(**it);
+ (*it)->clear();
+ }
qDeleteAll(m_userSections);
m_userSections.clear();
+
// load the default preferences
loadPreferences(m_defaultsFilename, m_defaultsSections);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|