From cdf3cdb1ccf408fde0256cbbb10f09cf9436b5bb Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Wed, 26 Dec 2018 20:31:57 +0100 Subject: Fixed regression after fixing memory leak --- src/configimpl.l | 4 ++-- src/marshal.cpp | 9 +++++++-- src/memberlist.cpp | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/configimpl.l b/src/configimpl.l index b533910..644250f 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -712,7 +712,7 @@ static void readIncludeFile(const char *incName) if (option==0) // oops not known { config_warn("ignoring unsupported tag `%s' at line %d, file %s\n", - yytext,yyLineNr,yyFileName.data()); + cmd.data(),yyLineNr,yyFileName.data()); BEGIN(SkipInvalid); } else // known tag @@ -788,7 +788,7 @@ static void readIncludeFile(const char *incName) if (option==0) // oops not known { config_warn("ignoring unsupported tag `%s' at line %d, file %s\n", - yytext,yyLineNr,yyFileName.data()); + cmd.data(),yyLineNr,yyFileName.data()); BEGIN(SkipInvalid); } else // known tag diff --git a/src/marshal.cpp b/src/marshal.cpp index 1c7d54e..c68718a 100644 --- a/src/marshal.cpp +++ b/src/marshal.cpp @@ -142,7 +142,6 @@ void marshalSectionInfoList(StorageIntf *s, QList *anchors) marshalQCString(s,si->fileName); marshalInt(s,si->lineNr); marshalInt(s,si->level); - delete Doxygen::sectionDict->take(si->label); // this dict owns the anchor objects } anchors->clear(); } @@ -564,12 +563,18 @@ QList *unmarshalSectionInfoList(StorageIntf *s) QCString fileName = unmarshalQCString(s); int lineNr = unmarshalInt(s); int level = unmarshalInt(s); - if (Doxygen::sectionDict->find(label)==0) + SectionInfo *si = Doxygen::sectionDict->find(label); + if (si==0) // This should actually never be true since all anchors should be in sectionDict. + // Could still optimize the marshaling routine by only storing label. { SectionInfo *si = new SectionInfo(fileName,lineNr,label,title,type,level,ref); anchors->append(si); Doxygen::sectionDict->append(label,si); // this dict owns the anchor objects } + else + { + anchors->append(si); + } } return anchors; } diff --git a/src/memberlist.cpp b/src/memberlist.cpp index a4e5596..abb8aff 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -745,7 +745,7 @@ void MemberList::writeDocumentation(OutputList &ol, } if (memberGroupList) { - printf("MemberList::writeDocumentation() -- member groups %d\n",memberGroupList->count()); + //printf("MemberList::writeDocumentation() -- member groups %d\n",memberGroupList->count()); MemberGroupListIterator mgli(*memberGroupList); MemberGroup *mg; for (;(mg=mgli.current());++mgli) -- cgit v0.12