Skip to content

Commit

Permalink
Fixed a couple of small memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri van Heesch committed Nov 14, 2015
1 parent 0918a19 commit 85ddfc8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/classdef.cpp
Expand Up @@ -2603,7 +2603,7 @@ void ClassDef::setTypeConstraints(ArgumentList *al)
void ClassDef::setTemplateArguments(ArgumentList *al)
{
if (al==0) return;
if (!m_impl->tempArgs) delete m_impl->tempArgs; // delete old list if needed
if (m_impl->tempArgs) delete m_impl->tempArgs; // delete old list if needed
//printf("setting template args '%s' for '%s'\n",tempArgListToString(al,getLanguage()).data(),name().data());
m_impl->tempArgs=new ArgumentList;
ArgumentListIterator ali(*al);
Expand Down
6 changes: 4 additions & 2 deletions src/pre.l
Expand Up @@ -1659,6 +1659,7 @@ static void endCondSection()
{
CondCtx *ctx = g_condStack.pop();
g_skip=ctx->skip;
delete ctx;
}
//printf("endCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
}
Expand All @@ -1667,7 +1668,7 @@ static void forceEndCondSection()
{
while (!g_condStack.isEmpty())
{
g_condStack.pop();
delete g_condStack.pop();
}
g_skip=FALSE;
}
Expand Down Expand Up @@ -3010,8 +3011,8 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
g_includeStack.clear();
g_expandedDict->setAutoDelete(FALSE);
g_expandedDict->clear();
g_condStack.clear();
g_condStack.setAutoDelete(TRUE);
g_condStack.clear();
//g_fileDefineDict->clear();

setFileName(fileName);
Expand Down Expand Up @@ -3161,6 +3162,7 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label %s ",ctx->sectionId.data());
warn(fileName,ctx->lineNr,"Conditional section%sdoes not have "
"a corresponding \\endcond command within this file.",sectionInfo.data());
delete ctx;
}
// make sure we don't extend a \cond with missing \endcond over multiple files (see bug 624829)
forceEndCondSection();
Expand Down

0 comments on commit 85ddfc8

Please sign in to comment.