diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2018-12-26 08:49:26 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2018-12-26 10:49:42 (GMT) |
commit | b6662b61dd83be32481a1c83e092082e9d797f0a (patch) | |
tree | fcf4bf395d5bc6de2cbf94fc78dc25bd8772a521 /src/marshal.cpp | |
parent | 348a8cc72dd481fa9e65e6209946bfeef5716914 (diff) | |
download | Doxygen-b6662b61dd83be32481a1c83e092082e9d797f0a.zip Doxygen-b6662b61dd83be32481a1c83e092082e9d797f0a.tar.gz Doxygen-b6662b61dd83be32481a1c83e092082e9d797f0a.tar.bz2 |
Fixed some more small memory leaks
Diffstat (limited to 'src/marshal.cpp')
-rw-r--r-- | src/marshal.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/marshal.cpp b/src/marshal.cpp index 57ff44b..1c7d54e 100644 --- a/src/marshal.cpp +++ b/src/marshal.cpp @@ -10,6 +10,7 @@ #include "groupdef.h" #include "example.h" #include "arguments.h" +#include "doxygen.h" #define HEADER ('D'<<24)+('O'<<16)+('X'<<8)+'!' @@ -141,7 +142,9 @@ void marshalSectionInfoList(StorageIntf *s, QList<SectionInfo> *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(); } } @@ -550,11 +553,10 @@ QList<SectionInfo> *unmarshalSectionInfoList(StorageIntf *s) uint i; uint count = unmarshalUInt(s); if (count==NULL_LIST) return 0; // null list - QList<SectionInfo> *result = new QList<SectionInfo>; - result->setAutoDelete(TRUE); + QList<SectionInfo> *anchors = new QList<SectionInfo>; assert(count<1000000); for (i=0;i<count;i++) - { + { QCString label = unmarshalQCString(s); QCString title = unmarshalQCString(s); QCString ref = unmarshalQCString(s); @@ -562,9 +564,14 @@ QList<SectionInfo> *unmarshalSectionInfoList(StorageIntf *s) QCString fileName = unmarshalQCString(s); int lineNr = unmarshalInt(s); int level = unmarshalInt(s); - result->append(new SectionInfo(fileName,lineNr,label,title,type,level,ref)); + if (Doxygen::sectionDict->find(label)==0) + { + 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 + } } - return result; + return anchors; } QList<ListItemInfo> *unmarshalItemInfoList(StorageIntf *s) |