Explorar o código

bugfix WAV channel leak

ncannasse %!s(int64=11) %!d(string=hai) anos
pai
achega
7f72f2d974
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      hxd/res/Sound.hx

+ 3 - 0
hxd/res/Sound.hx

@@ -123,6 +123,9 @@ class Sound extends Resource {
 	public function playAt( startPosition : Float ) {
 		#if flash
 		if( snd != null ) {
+			// can't mix two wavs
+			if( wavHeader != null && channel != null )
+				return;
 			bytesPosition = 0;
 			channel = snd.play(startPosition,loop?0x7FFFFFFF:0);
 			volume = volume;