【问题标题】:Animated gif File In NSImageView eats the Memory (Mac Development)NSImageView 中的动画 gif 文件吃掉内存(Mac 开发)
【发布时间】:2011-01-11 13:11:31
【问题描述】:

我只是尝试放置从 url Request 获取的 6 帧动画 gif 文件并使用响应创建 nsimage,然后在 NSImageView 中设置 Image ...

我用这个

// Where returnedImage is nsImage I created with response of the connection ..
    [myImageView setImage:[response returnedImage]];

我使用此代码更改某些用户操作发生时显示的图像

我观察到分配给程序的内存随着大规模线性增加......并且应用程序可能会崩溃

我确保我的代码没有泄漏...

不知道为什么会增加,是不是要释放之前设置的Image

任何想法都会受到赞赏。

【问题讨论】:

    标签: macos memory-leaks animated-gif nsimageview


    【解决方案1】:

    我在 Nib 文件中删除并重新创建了 NSImageView ...我可能是一个 xcode 部署错误或什么的 ,,, 但我为显卡分配了一些内存不断增加

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-03-24
      • 1970-01-01
      • 2020-05-20
      • 1970-01-01
      • 2011-02-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多