Skip to content
Commit a8cd8f99 authored by Michael Hanselmann's avatar Michael Hanselmann Committed by Shazron Abdullah
Browse files

[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: default avatarMichael Hanselmann <public@hansmi.ch>
parent 65890edf
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment