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 { ...@@ -18,7 +18,8 @@ export default class SoundMgr {
if (!this.enabled) return; if (!this.enabled) return;
engine.playSound(nameToUuid[name], { engine.playSound(nameToUuid[name], {
loop: false loop: false,
keep: true
}, name); }, name);
} }
......
let share = { const share = {
title: engine.env.shareTitle, title: engine.env.shareTitle,
desc: engine.env.shareDesc, desc: engine.env.shareDesc,
link: engine.env.shareLink, link: window.location.href,
imgUrl: engine.env.shareImgUrl 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.ready(function () {
wx.onMenuShareTimeline({ wx.onMenuShareTimeline({
title: share.title, title: share.title,
desc: share.desc, desc: share.desc,
link: share.url, link: share.link,
imgUrl: share.imgUrl, imgUrl: share.imgUrl,
success: function () { success: function () {
mui.Toast.show("分享成功"); engine.globalEvent.dispatchEvent("ShareSuccess");
engine.globalEvent.dispatchEvent("ShareSuccess"); },
}, cancel: function () {
cancel: function () { engine.globalEvent.dispatchEvent("ShareCancel");
mui.Toast.show("分享取消"); }
engine.globalEvent.dispatchEvent("ShareCancel"); });
}
});
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
title: share.title, title: share.title,
desc: share.desc, desc: share.desc,
link: share.url, link: share.link,
imgUrl: share.imgUrl, imgUrl: share.imgUrl,
success: function () { success: function () {
mui.Toast.show("分享成功"); engine.globalEvent.dispatchEvent("ShareSuccess");
engine.globalEvent.dispatchEvent("ShareSuccess"); },
}, cancel: function () {
cancel: function () { engine.globalEvent.globa.dispatchEvent("ShareCancel");
mui.Toast.show("分享取消"); }
engine.globalEvent.globa.dispatchEvent("ShareCancel"); });
} });
}); }, () => { console.error("get wx config error"); });
\ No newline at end of file \ 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