Skip to content

Commit ee5c56c

Browse files
Instantiating lockedActionsQueue only when used
1 parent 44a377f commit ee5c56c

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/sound/html5/HTML5AudioSoundManager.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ var HTML5AudioSoundManager = new Class({
9696
* @private
9797
* @since 3.0.0
9898
*/
99-
this.lockedActionsQueue = this.locked ? [] : null;
99+
this.lockedActionsQueue = null;
100100

101101
/**
102102
* Property that actually holds the value of global mute
@@ -156,7 +156,11 @@ var HTML5AudioSoundManager = new Class({
156156
{
157157
this.locked = 'ontouchstart' in window;
158158

159-
if(!this.locked)
159+
if(this.locked)
160+
{
161+
this.lockedActionsQueue = [];
162+
}
163+
else
160164
{
161165
return;
162166
}
@@ -249,6 +253,7 @@ var HTML5AudioSoundManager = new Class({
249253

250254
this.lockedActionsQueue.length = 0;
251255
this.lockedActionsQueue = null;
256+
252257
}, this);
253258

254259
document.body.addEventListener('touchmove', detectMove, false);

0 commit comments

Comments
 (0)