diff options
author | Walter van Niftrik | 2015-03-24 11:36:26 +0100 |
---|---|---|
committer | Matthew Hoops | 2015-07-07 20:19:48 -0400 |
commit | 56c0238f9bc5f013cae0d487ef88dae3c29f6305 (patch) | |
tree | 85feda7d90fae4680ab5240e44292dee8893d82a /engines/sci/sound | |
parent | 82f585871bdb435d6f30d7005456dba0fb90c985 (diff) | |
download | scummvm-rg350-56c0238f9bc5f013cae0d487ef88dae3c29f6305.tar.gz scummvm-rg350-56c0238f9bc5f013cae0d487ef88dae3c29f6305.tar.bz2 scummvm-rg350-56c0238f9bc5f013cae0d487ef88dae3c29f6305.zip |
SCI: Delete OPL when init fails
Diffstat (limited to 'engines/sci/sound')
-rw-r--r-- | engines/sci/sound/drivers/adlib.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/sci/sound/drivers/adlib.cpp b/engines/sci/sound/drivers/adlib.cpp index da222fb2da..4f557be95e 100644 --- a/engines/sci/sound/drivers/adlib.cpp +++ b/engines/sci/sound/drivers/adlib.cpp @@ -236,8 +236,11 @@ int MidiDriver_AdLib::openAdLib(bool isSCI0) { if (!_opl) return -1; - if (!_opl->init()) + if (!_opl->init()) { + delete _opl; + _opl = nullptr; return -1; + } setRegister(0xBD, 0); setRegister(0x08, 0); |