浏览代码

bugfix WAV channel leak

ncannasse 11 年之前
父节点
当前提交
7f72f2d974
共有 1 个文件被更改,包括 3 次插入0 次删除
  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;