在 Adobe AIR 中使用 SWFLoader 时出现内存泄漏
我正在尝试在另一个窗口应用程序中加载窗口子应用程序,要求是根据用户操作将一个加载的应用程序替换为另一个加载的应用程序。
我尝试了主窗口应用程序中 swfLoader
上记录的 unloadAndStop
() 方法,但在内存分析过程中,我可以看到这些应用程序的实例保留在内存中即使在显式运行垃圾收集之后。
如果我将这些窗口应用程序作为模块,然后尝试使用 Moduleloader 加载它们,事情就会顺利进行,并且卸载的模块将从内存中删除。
有人以前遇到过同样的问题吗?
I'm trying to load windowed sub-application in another windowed application, The requirement is to replace one loaded application with another on user action.
I tried the documented method of unloadAndStop
() on the swfLoader
in the main windowed application, but somehow during memory profiling I could see the instances of those applications were maintained in the memory even after explicitly running garbage collection.
Where as If I make those windowed application as modules, and then try to load them using the Moduleloader things work smoothly and unloaded modules are removed from memory.
Any one faced the same issue before ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个 Flex SDK 错误。
It's a Flex SDK Bug.
首先,您应该在应用程序中加载应用程序。各种疯狂的事情都可能发生。你的情况我以前也遇到过。我所做的就是为任何应用程序或模块任务分离出我的实际 UI/产品。例如:
或者
你知道我要说什么吗?现在,您的产品有了一个可重用的“主”组件,可以在任何上下文中使用,甚至是
WindowedApplication
:)First, you should load an application within an application. All sorts of crazy things could happen. I have encountered your situation in the past. What I have done is separate out my actual UI/Product for any Application or Module task. For example:
or
You see where I'm going with this? You now have a reusable "main" component for your product with can be used in whichever context, even the
WindowedApplication
one :)