summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-02-03 20:35:28 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-02-03 20:35:28 (GMT)
commit2514ba72e53473f8dd424efdbef34287c8a3fd56 (patch)
treef8a1cf0c1aa221e782f658e9612d965ca7fe1f66
parent0dc96d28963f2260786650be0a5fa360d02045ae (diff)
downloadDoxygen-2514ba72e53473f8dd424efdbef34287c8a3fd56.zip
Doxygen-2514ba72e53473f8dd424efdbef34287c8a3fd56.tar.gz
Doxygen-2514ba72e53473f8dd424efdbef34287c8a3fd56.tar.bz2
Fixed memory leak in nested comment administration
-rw-r--r--src/commentcnv.l8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l
index b12623c..21ebd02 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -646,7 +646,7 @@ void replaceComment(int offset);
else
{
g_nestingCount--;
- CommentCtx *ctx = g_commentStack.pop();
+ delete g_commentStack.pop();
}
}
}
@@ -988,7 +988,6 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
if (g_lang==SrcLangExt_Markdown)
{
g_nestingCount=0;
- g_commentStack.clear(); /* to be on the save side */
BEGIN(CComment);
g_commentStack.push(new CommentCtx(g_lineNr));
}
@@ -1007,14 +1006,15 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
}
if (g_nestingCount>0 || (YY_START==CComment && g_lang!=SrcLangExt_Markdown))
{
- QString tmp= "(probable line reference: ";
+ QCString tmp= "(probable line reference: ";
bool first = TRUE;
while (!g_commentStack.isEmpty())
{
CommentCtx *ctx = g_commentStack.pop();
if (!first) tmp += ", ";
- tmp += QString::number(ctx->lineNr);
+ tmp += QCString().setNum(ctx->lineNr);
first = FALSE;
+ delete ctx;
}
tmp += ")";
warn(g_fileName,g_lineNr,"Reached end of file while still inside a (nested) comment. "