|
Than Ngo |
3b8354 |
commit 85ddfc814f33943199928447b4627d05b0920b99
|
|
Than Ngo |
3b8354 |
Author: Dimitri van Heesch <dimitri@stack.nl>
|
|
Than Ngo |
3b8354 |
Date: Sat Nov 14 13:50:56 2015 +0100
|
|
Than Ngo |
3b8354 |
|
|
Than Ngo |
3b8354 |
Fixed a couple of small memory leaks
|
|
Than Ngo |
3b8354 |
|
|
Than Ngo |
3b8354 |
diff --git a/src/classdef.cpp b/src/classdef.cpp
|
|
Than Ngo |
3b8354 |
index fa555ac..88f9a70 100644
|
|
Than Ngo |
3b8354 |
--- a/src/classdef.cpp
|
|
Than Ngo |
3b8354 |
+++ b/src/classdef.cpp
|
|
Than Ngo |
3b8354 |
@@ -2603,7 +2603,7 @@ void ClassDef::setTypeConstraints(ArgumentList *al)
|
|
Than Ngo |
3b8354 |
void ClassDef::setTemplateArguments(ArgumentList *al)
|
|
Than Ngo |
3b8354 |
{
|
|
Than Ngo |
3b8354 |
if (al==0) return;
|
|
Than Ngo |
3b8354 |
- if (!m_impl->tempArgs) delete m_impl->tempArgs; // delete old list if needed
|
|
Than Ngo |
3b8354 |
+ if (m_impl->tempArgs) delete m_impl->tempArgs; // delete old list if needed
|
|
Than Ngo |
3b8354 |
//printf("setting template args '%s' for '%s'\n",tempArgListToString(al,getLanguage()).data(),name().data());
|
|
Than Ngo |
3b8354 |
m_impl->tempArgs=new ArgumentList;
|
|
Than Ngo |
3b8354 |
ArgumentListIterator ali(*al);
|
|
Than Ngo |
3b8354 |
diff --git a/src/pre.l b/src/pre.l
|
|
Than Ngo |
3b8354 |
index 86f9ebb..18f3b1d 100644
|
|
Than Ngo |
3b8354 |
--- a/src/pre.l
|
|
Than Ngo |
3b8354 |
+++ b/src/pre.l
|
|
Than Ngo |
3b8354 |
@@ -1659,6 +1659,7 @@ static void endCondSection()
|
|
Than Ngo |
3b8354 |
{
|
|
Than Ngo |
3b8354 |
CondCtx *ctx = g_condStack.pop();
|
|
Than Ngo |
3b8354 |
g_skip=ctx->skip;
|
|
Than Ngo |
3b8354 |
+ delete ctx;
|
|
Than Ngo |
3b8354 |
}
|
|
Than Ngo |
3b8354 |
//printf("endCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
|
|
Than Ngo |
3b8354 |
}
|
|
Than Ngo |
3b8354 |
@@ -1667,7 +1668,7 @@ static void forceEndCondSection()
|
|
Than Ngo |
3b8354 |
{
|
|
Than Ngo |
3b8354 |
while (!g_condStack.isEmpty())
|
|
Than Ngo |
3b8354 |
{
|
|
Than Ngo |
3b8354 |
- g_condStack.pop();
|
|
Than Ngo |
3b8354 |
+ delete g_condStack.pop();
|
|
Than Ngo |
3b8354 |
}
|
|
Than Ngo |
3b8354 |
g_skip=FALSE;
|
|
Than Ngo |
3b8354 |
}
|
|
Than Ngo |
3b8354 |
@@ -3010,8 +3011,8 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
|
|
Than Ngo |
3b8354 |
g_includeStack.clear();
|
|
Than Ngo |
3b8354 |
g_expandedDict->setAutoDelete(FALSE);
|
|
Than Ngo |
3b8354 |
g_expandedDict->clear();
|
|
Than Ngo |
3b8354 |
- g_condStack.clear();
|
|
Than Ngo |
3b8354 |
g_condStack.setAutoDelete(TRUE);
|
|
Than Ngo |
3b8354 |
+ g_condStack.clear();
|
|
Than Ngo |
3b8354 |
//g_fileDefineDict->clear();
|
|
Than Ngo |
3b8354 |
|
|
Than Ngo |
3b8354 |
setFileName(fileName);
|
|
Than Ngo |
3b8354 |
@@ -3161,6 +3162,7 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
|
|
Than Ngo |
3b8354 |
if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label %s ",ctx->sectionId.data());
|
|
Than Ngo |
3b8354 |
warn(fileName,ctx->lineNr,"Conditional section%sdoes not have "
|
|
Than Ngo |
3b8354 |
"a corresponding \\endcond command within this file.",sectionInfo.data());
|
|
Than Ngo |
3b8354 |
+ delete ctx;
|
|
Than Ngo |
3b8354 |
}
|
|
Than Ngo |
3b8354 |
// make sure we don't extend a \cond with missing \endcond over multiple files (see bug 624829)
|
|
Than Ngo |
3b8354 |
forceEndCondSection();
|