Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

针对 Pomelo.as 内 onData 事件对 _pkg 清理时机不当的问题,做了少量调整 #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dashaomai
Copy link

在 Pomelo.as 内,经处理获取 _pkg.body 后,会进入 swith (_pkg.type) 进行各种判断和处理。但 _pkg = null 的时机,有几个在 dispatchEvent 及 callback.call 之后。

如果外界的事件处理或回调处理过程中出现错误,则在 dispatchEvent 或 callback.call 之后的代码都不会被执行,包括 _pkg = null。

所以我将 _pkg 的清理时机提前,在用完它之后马上清除;并将清除代码多写了几行,以策内存安全。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant