Blame doxygen-1.8.18-memory-leaks.patch

Than Ngo 39bce8
commit 30f8609975062896b0cd43b739310ab8d667ea82
Than Ngo 39bce8
Author: Dimitri van Heesch <doxygen@gmail.com>
Than Ngo 39bce8
Date:   Sun Apr 26 20:44:17 2020 +0200
Than Ngo 39bce8
Than Ngo 39bce8
    Fixed 2 small memory leaks
Than Ngo 39bce8
Than Ngo 39bce8
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
Than Ngo 39bce8
index 1d15a91b..2ceece91 100644
Than Ngo 39bce8
--- a/src/doxygen.cpp
Than Ngo 39bce8
+++ b/src/doxygen.cpp
Than Ngo 39bce8
@@ -1900,25 +1900,22 @@ static void findUsingDeclImports(const Entry *root)
Than Ngo 39bce8
                 if (md && md->protection()!=Private)
Than Ngo 39bce8
                 {
Than Ngo 39bce8
                   //printf("found member %s\n",mni->memberName());
Than Ngo 39bce8
-                  MemberDef *newMd = 0;
Than Ngo 39bce8
+                  QCString fileName = root->fileName;
Than Ngo 39bce8
+                  if (fileName.isEmpty() && root->tagInfo())
Than Ngo 39bce8
                   {
Than Ngo 39bce8
-                    QCString fileName = root->fileName;
Than Ngo 39bce8
-                    if (fileName.isEmpty() && root->tagInfo())
Than Ngo 39bce8
-                    {
Than Ngo 39bce8
-                      fileName = root->tagInfo()->tagName;
Than Ngo 39bce8
-                    }
Than Ngo 39bce8
-                    const ArgumentList &templAl = md->templateArguments();
Than Ngo 39bce8
-                    const ArgumentList &al = md->templateArguments();
Than Ngo 39bce8
-                    newMd = createMemberDef(
Than Ngo 39bce8
-                      fileName,root->startLine,root->startColumn,
Than Ngo 39bce8
-                      md->typeString(),memName,md->argsString(),
Than Ngo 39bce8
-                      md->excpString(),root->protection,root->virt,
Than Ngo 39bce8
-                      md->isStatic(),Member,md->memberType(),
Than Ngo 39bce8
-                      templAl,al,root->metaData
Than Ngo 39bce8
-                      );
Than Ngo 39bce8
+                    fileName = root->tagInfo()->tagName;
Than Ngo 39bce8
                   }
Than Ngo 39bce8
+                  const ArgumentList &templAl = md->templateArguments();
Than Ngo 39bce8
+                  const ArgumentList &al = md->templateArguments();
Than Ngo 39bce8
+                  std::unique_ptr<MemberDef> newMd { createMemberDef(
Than Ngo 39bce8
+                    fileName,root->startLine,root->startColumn,
Than Ngo 39bce8
+                    md->typeString(),memName,md->argsString(),
Than Ngo 39bce8
+                    md->excpString(),root->protection,root->virt,
Than Ngo 39bce8
+                    md->isStatic(),Member,md->memberType(),
Than Ngo 39bce8
+                    templAl,al,root->metaData
Than Ngo 39bce8
+                    ) };
Than Ngo 39bce8
                   newMd->setMemberClass(cd);
Than Ngo 39bce8
-                  cd->insertMember(newMd);
Than Ngo 39bce8
+                  cd->insertMember(newMd.get());
Than Ngo 39bce8
                   if (!root->doc.isEmpty() || !root->brief.isEmpty())
Than Ngo 39bce8
                   {
Than Ngo 39bce8
                     newMd->setDocumentation(root->doc,root->docFile,root->docLine);
Than Ngo 39bce8
@@ -1946,6 +1943,8 @@ static void findUsingDeclImports(const Entry *root)
Than Ngo 39bce8
                   newMd->setMemberSpecifiers(md->getMemberSpecifiers());
Than Ngo 39bce8
                   newMd->setLanguage(root->lang);
Than Ngo 39bce8
                   newMd->setId(root->id);
Than Ngo 39bce8
+                  MemberName *mn = Doxygen::memberNameLinkedMap->add(memName);
Than Ngo 39bce8
+                  mn->push_back(std::move(newMd));
Than Ngo 39bce8
                 }
Than Ngo 39bce8
               }
Than Ngo 39bce8
             }
Than Ngo 39bce8
@@ -9739,6 +9738,7 @@ void initDoxygen()
Than Ngo 39bce8
   Doxygen::exampleSDict->setAutoDelete(TRUE);
Than Ngo 39bce8
   Doxygen::memGrpInfoDict.setAutoDelete(TRUE);
Than Ngo 39bce8
   Doxygen::tagDestinationDict.setAutoDelete(TRUE);
Than Ngo 39bce8
+  Doxygen::namespaceAliasDict.setAutoDelete(TRUE);
Than Ngo 39bce8
   Doxygen::dirRelations.setAutoDelete(TRUE);
Than Ngo 39bce8
   Doxygen::genericsDict = new GenericsSDict;
Than Ngo 39bce8
   Doxygen::indexList = new IndexList;