Destroy XMLReader object attached to Reader one when this one is gone as to avoid

potential memory leaks.
This commit is contained in:
Jean-Marie Verdun
2019-08-30 13:51:47 +02:00
committed by wmayer
parent dda591ec6e
commit e20456dc1f
2 changed files with 7 additions and 0 deletions

View File

@@ -563,6 +563,12 @@ Base::Reader::Reader(std::istream& str, const std::string& name, int version)
{
}
Base::Reader::~Reader()
{
if ( this->localreader != nullptr )
delete this->localreader;
}
std::string Base::Reader::getFileName() const
{
return this->_name;

View File

@@ -295,6 +295,7 @@ class BaseExport Reader : public std::istream
{
public:
Reader(std::istream&, const std::string&, int version);
~Reader();
std::istream& getStream();
std::string getFileName() const;
int getFileVersion() const;