diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2019-12-08 10:18:56 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2019-12-08 10:18:56 (GMT) |
commit | 6d4835dbe01a27923db8a1e4559b61da5065cb7a (patch) | |
tree | 9369a394c03978c79e20ec905cbd892e27fabdd6 /src/entry.h | |
parent | 4a4fcdf7931efba208a57b658185de689f2ef7fb (diff) | |
download | Doxygen-6d4835dbe01a27923db8a1e4559b61da5065cb7a.zip Doxygen-6d4835dbe01a27923db8a1e4559b61da5065cb7a.tar.gz Doxygen-6d4835dbe01a27923db8a1e4559b61da5065cb7a.tar.bz2 |
Changed std::unique_ptr<Entry> to std::shared_ptr<Entry> at avoid use after free issues
Diffstat (limited to 'src/entry.h')
-rw-r--r-- | src/entry.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/entry.h b/src/entry.h index 9d4ae9d..0391075 100644 --- a/src/entry.h +++ b/src/entry.h @@ -202,26 +202,26 @@ class Entry /*! Returns the list of children for this Entry * @see addSubEntry() and removeSubEntry() */ - const std::vector< std::unique_ptr<Entry> > &children() const { return m_sublist; } + const std::vector< std::shared_ptr<Entry> > &children() const { return m_sublist; } /*! @name add entry as a child and pass ownership. * @note This makes the entry passed invalid! (TODO: tclscanner.l still has use after move!) * @{ */ void moveToSubEntryAndKeep(Entry* e); - void moveToSubEntryAndKeep(std::unique_ptr<Entry> &e); + void moveToSubEntryAndKeep(std::shared_ptr<Entry> &e); /*! @} */ /*! @name add entry as a child, pass ownership and reinitialize entry */ void moveToSubEntryAndRefresh(Entry* &e); - void moveToSubEntryAndRefresh(std::unique_ptr<Entry> &e); + void moveToSubEntryAndRefresh(std::shared_ptr<Entry> &e); /*! take \a child of of to list of children and move it into \a moveTo */ - void moveFromSubEntry(const Entry *child,std::unique_ptr<Entry> &moveTo); + void moveFromSubEntry(const Entry *child,std::shared_ptr<Entry> &moveTo); /*! make a copy of \a e and add it as a child to this entry */ void copyToSubEntry (Entry* e); - void copyToSubEntry (const std::unique_ptr<Entry> &e); + void copyToSubEntry (const std::shared_ptr<Entry> &e); /*! Removes entry \a e from the list of children. * The entry will be deleted if found. @@ -332,7 +332,7 @@ class Entry private: Entry *m_parent; //!< parent node in the tree - std::vector< std::unique_ptr<Entry> > m_sublist; + std::vector< std::shared_ptr<Entry> > m_sublist; Entry &operator=(const Entry &); FileDef *m_fileDef; }; |