Fixed #111 -- removed unnecessary null checks.

This commit is contained in:
casey langen 2017-07-31 20:06:05 -07:00
parent 75abe1f0f5
commit d9a8b17a6f
2 changed files with 6 additions and 12 deletions

View File

@ -116,10 +116,8 @@ void LocalLibrary::Close() {
{ {
std::unique_lock<std::mutex> lock(this->mutex); std::unique_lock<std::mutex> lock(this->mutex);
if (this->indexer) { delete this->indexer;
delete this->indexer; this->indexer = nullptr;
this->indexer = nullptr;
}
if (this->thread) { if (this->thread) {
thread = this->thread; thread = this->thread;

View File

@ -52,15 +52,11 @@ FlacDecoder::FlacDecoder()
} }
FlacDecoder::~FlacDecoder() { FlacDecoder::~FlacDecoder() {
if (this->decoder) { FLAC__stream_decoder_delete(this->decoder);
FLAC__stream_decoder_delete(this->decoder); this->decoder = NULL;
this->decoder = NULL;
}
if (this->outputBuffer) { delete this->outputBuffer;
delete this->outputBuffer; this->outputBuffer = NULL;
this->outputBuffer = NULL;
}
} }
FLAC__StreamDecoderReadStatus FlacDecoder::FlacRead( FLAC__StreamDecoderReadStatus FlacDecoder::FlacRead(