wx.offMemoryWarning

wx.offMemoryWarning(function listener)

基础库 2.9.0 开始支持,低版本需做兼容处理

小程序插件:不支持

相关文档: 内存优化

功能描述

移除内存不足告警事件的监听函数

参数

function listener

onMemoryWarning 传入的监听函数。不传此参数则移除所有监听函数。

示例代码

const listener = function (res) { console.log(res) }

wx.onMemoryWarning(listener)
wx.offMemoryWarning(listener) // 需传入与监听时同一个的函数对象
posted on 2025-01-12 20:30  AtlasLapetos  阅读(9)  评论(0)    收藏  举报