removed useless code

In destructors, zeroing attributes or clearing containers is utterly useless.
pull/4077/head
Krishty 2021-09-11 21:51:20 +02:00
parent d34cd103f4
commit 4cf4e7454f
8 changed files with 0 additions and 11 deletions

View File

@ -186,7 +186,6 @@ D3MFOpcPackage::D3MFOpcPackage(IOSystem *pIOHandler, const std::string &rFile) :
D3MFOpcPackage::~D3MFOpcPackage() { D3MFOpcPackage::~D3MFOpcPackage() {
mZipArchive->Close(mRootStream); mZipArchive->Close(mRootStream);
delete mZipArchive; delete mZipArchive;
mZipArchive = nullptr;
} }
IOStream *D3MFOpcPackage::RootStream() const { IOStream *D3MFOpcPackage::RootStream() const {

View File

@ -290,7 +290,6 @@ OpenGEXImporter::OpenGEXImporter() :
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
OpenGEXImporter::~OpenGEXImporter() { OpenGEXImporter::~OpenGEXImporter() {
m_ctx = nullptr;
} }
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------

View File

@ -146,9 +146,6 @@ Q3BSPFileImporter::Q3BSPFileImporter() :
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Destructor. // Destructor.
Q3BSPFileImporter::~Q3BSPFileImporter() { Q3BSPFileImporter::~Q3BSPFileImporter() {
m_pCurrentMesh = nullptr;
m_pCurrentFace = nullptr;
// Clear face-to-material map // Clear face-to-material map
for (FaceMap::iterator it = m_MaterialLookupMap.begin(); it != m_MaterialLookupMap.end(); ++it) { for (FaceMap::iterator it = m_MaterialLookupMap.begin(); it != m_MaterialLookupMap.end(); ++it) {
const std::string &matName = it->first; const std::string &matName = it->first;
@ -156,7 +153,6 @@ Q3BSPFileImporter::~Q3BSPFileImporter() {
delete it->second; delete it->second;
} }
} }
m_MaterialLookupMap.clear();
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------

View File

@ -78,7 +78,6 @@ Q3BSPFileParser::Q3BSPFileParser( const std::string &mapName, ZipArchiveIOSystem
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
Q3BSPFileParser::~Q3BSPFileParser() { Q3BSPFileParser::~Q3BSPFileParser() {
delete m_pModel; delete m_pModel;
m_pModel = nullptr;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------

View File

@ -100,7 +100,6 @@ XGLImporter::XGLImporter() :
// Destructor, private as well // Destructor, private as well
XGLImporter::~XGLImporter() { XGLImporter::~XGLImporter() {
delete mXmlParser; delete mXmlParser;
mXmlParser = nullptr;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------

View File

@ -51,7 +51,6 @@ CIOStreamWrapper::~CIOStreamWrapper() {
/* Various places depend on this destructor to close the file */ /* Various places depend on this destructor to close the file */
if (mFile) { if (mFile) {
mIO->mFileSystem->CloseProc(mIO->mFileSystem, mFile); mIO->mFileSystem->CloseProc(mIO->mFileSystem, mFile);
mFile = nullptr;
} }
} }

View File

@ -82,7 +82,6 @@ inline int select_fseek<8>(FILE *file, int64_t offset, int origin) {
DefaultIOStream::~DefaultIOStream() { DefaultIOStream::~DefaultIOStream() {
if (mFile) { if (mFile) {
::fclose(mFile); ::fclose(mFile);
mFile = nullptr;
} }
} }

View File

@ -352,7 +352,6 @@ ZipArchiveIOSystem::Implement::Implement(IOSystem *pIOHandler, const char *pFile
ZipArchiveIOSystem::Implement::~Implement() { ZipArchiveIOSystem::Implement::~Implement() {
if (m_ZipFileHandle != nullptr) { if (m_ZipFileHandle != nullptr) {
unzClose(m_ZipFileHandle); unzClose(m_ZipFileHandle);
m_ZipFileHandle = nullptr;
} }
} }