- blocked the destructor in the sound font reader base class.

If ZMusic is to act like an external library it may not call delete on external objects because there is no guarantee that they use the same allocator. Deletion must be done as a virtual function to ensure that the correct operator delete gets called, which, unlike the actual destructor is not virtual itself.
This commit is contained in:
Christoph Oelckers 2020-01-01 16:11:39 +01:00
commit fe0a6b00ce
4 changed files with 8 additions and 6 deletions

View file

@ -703,7 +703,7 @@ Instruments::~Instruments()
drumset[i] = NULL;
}
}
if (sfreader != nullptr) delete sfreader;
if (sfreader != nullptr) sfreader->close();
sfreader = nullptr;
}