[CB-4755] Fix crash in Media.setVolume on iOS
Media.setVolume caused the application to crash after Media.release was
called. Code causing crash:
var m = new Media("test.caf");
m.release();
m.setVolume(1); // crash in this call
The reason was that retrieving the CDVAudioFile instance from the sound
cache would return nil after Media.release. This patch fixes the issue
by explicitely checking for nil. It also does away with an unnecessary
cache initialization, which isn't needed as -[Media setVolume:] doesn't
write to the cache.
Signed-off-by:
Michael Hanselmann <public@hansmi.ch>
parent
65890edf
Please register or sign in to comment