Fix memory leak in MidiPlayer_Adlib.

svn-id: r47276
This commit is contained in:
Johannes Schickel 2010-01-12 20:26:49 +00:00
parent 3578f8d091
commit dd39b64ce4

View File

@ -161,7 +161,11 @@ private:
class MidiPlayer_Adlib : public MidiPlayer {
public:
MidiPlayer_Adlib() { _driver = new MidiDriver_Adlib(g_system->getMixer()); }
~MidiPlayer_Adlib() {}
int open(ResourceManager *resMan);
void close();
byte getPlayId(SciVersion soundVersion);
int getPolyphony() const { return MidiDriver_Adlib::kVoices; }
bool hasRhythmChannel() const { return false; }
@ -812,6 +816,14 @@ int MidiPlayer_Adlib::open(ResourceManager *resMan) {
return static_cast<MidiDriver_Adlib *>(_driver)->open(getSciVersion() <= SCI_VERSION_0_LATE);
}
void MidiPlayer_Adlib::close() {
if (_driver) {
_driver->close();
delete _driver;
_driver = 0;
}
}
byte MidiPlayer_Adlib::getPlayId(SciVersion soundVersion) {
switch (soundVersion) {
case SCI_VERSION_0_EARLY: