mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
Fix memory leak in MidiPlayer_Adlib.
svn-id: r47276
This commit is contained in:
parent
3578f8d091
commit
dd39b64ce4
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user