Commit 82952c24 authored by XieChuanJin's avatar XieChuanJin

修复音频内存泄漏

parent 72a15644
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -18,7 +18,8 @@ export default class SoundMgr {
if (!this.enabled) return;
engine.playSound(nameToUuid[name], {
loop: false
loop: false,
keep: true
}, name);
}
......
let share = {
const share = {
title: engine.env.shareTitle,
desc: engine.env.shareDesc,
link: engine.env.shareLink,
link: window.location.href,
imgUrl: engine.env.shareImgUrl
};
Net.sendGet("/wechatShare/getShareInfo/v2", {
wxdebug: false,
url: window.location.href
}, (res) => {
wx.config({
debug: false,
appId: res.wxappid,
timestamp: res.wxtimestamp,
nonceStr: res.wxnonceStr,
signature: res.wxsignature,
jsApiList: ['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage']
});
wx.error(function (res) {
console.error("wx error", res);
});
const share = args;
wx.onMenuShareTimeline({
title: share.title,
desc: share.desc,
link: share.url,
imgUrl: share.imgUrl,
success: function () {
mui.Toast.show("分享成功");
engine.globalEvent.dispatchEvent("ShareSuccess");
},
cancel: function () {
mui.Toast.show("分享取消");
engine.globalEvent.dispatchEvent("ShareCancel");
}
});
wx.ready(function () {
wx.onMenuShareTimeline({
title: share.title,
desc: share.desc,
link: share.link,
imgUrl: share.imgUrl,
success: function () {
engine.globalEvent.dispatchEvent("ShareSuccess");
},
cancel: function () {
engine.globalEvent.dispatchEvent("ShareCancel");
}
});
wx.onMenuShareAppMessage({
title: share.title,
desc: share.desc,
link: share.url,
imgUrl: share.imgUrl,
success: function () {
mui.Toast.show("分享成功");
engine.globalEvent.dispatchEvent("ShareSuccess");
},
cancel: function () {
mui.Toast.show("分享取消");
engine.globalEvent.globa.dispatchEvent("ShareCancel");
}
});
\ No newline at end of file
wx.onMenuShareAppMessage({
title: share.title,
desc: share.desc,
link: share.link,
imgUrl: share.imgUrl,
success: function () {
engine.globalEvent.dispatchEvent("ShareSuccess");
},
cancel: function () {
engine.globalEvent.globa.dispatchEvent("ShareCancel");
}
});
});
}, () => { console.error("get wx config error"); });
\ No newline at end of file
Markdown is supported
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