NSImageView 中的动画 gif 文件占用内存(Mac 开发)
我只是尝试将从 url 请求获取的 6 帧的动画 gif 文件放在其中,并使用响应创建 nsimage,然后在 NSImageView 中设置图像...
我使用这个
// Where returnedImage is nsImage I created with response of the connection ..
[myImageView setImage:[response returnedImage]];
我使用此代码来更改发生某些用户操作时显示的图像
我观察到分配给程序的内存大规模线性增加..应用程序可能会崩溃
我确保我的代码没有泄漏...
我不知道为什么它会增加,我是否必须释放以前的内存设置的图像
任何想法都将受到赞赏。
I just try to put Animated gif file with 6 frames acquired from url Request and create nsimage with the response ,,, then set the Image in NSImageView ...
I use this
// Where returnedImage is nsImage I created with response of the connection ..
[myImageView setImage:[response returnedImage]];
I use this code to change the Image displayed when some user actions happen
I observe that The memory allocated to the program is increased linearly with large scale .. and the application might crash
I make sure that my code has no leaks ...
I do not Know why it is increases , do I have to release the previous Image that was set
Any Idea will be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我删除并重新创建 Nib 文件中的 NSImageView ...我可能是 xcode 部署错误或其他什么,,, 但我分配了一些内存给显卡,不断增加
I delete and recreate the NSImageView In the Nib File ... I may be an xcode Deployment bug or something ,,, But i was allocate some memory to graphics card continuously increasing