MKMapView 内存泄漏
我在使用 MKMapView 时遇到内存泄漏问题。 MKMapView 本身被释放,但其他一些对象(如 MKTileView、MKMapTileViewImp 和 MKTiledLayer)不会被销毁,最终会重新创建和泄漏。
我用一段简单的代码重现了效果
@implementation ViewController
{
MKMapView * mapView;
}
- (void)leak:(id)sender
{
[mapView removeFromSuperview];
mapView = [[MKMapView alloc] initWithFrame: CGRectMake(20, 20, 20, 20)];
[self.view addSubview: mapView];
}
每次按下连接到泄漏的按钮时,MKTileView 的新实例就会泄漏。
我正在使用ARC。我查看了其他问题,但似乎没有人提到我在这里看到的相同泄漏。
有什么想法可能是我的问题吗?
I've got a problem with memory leaks in my use of MKMapView. The MKMapView itself is deallocated, but some other objects like MKTileView, MKMapTileViewImp, and MKTiledLayer don't get destroyed and end up recreated and leaking.
I've reproduced the effect in a simple piece of code
@implementation ViewController
{
MKMapView * mapView;
}
- (void)leak:(id)sender
{
[mapView removeFromSuperview];
mapView = [[MKMapView alloc] initWithFrame: CGRectMake(20, 20, 20, 20)];
[self.view addSubview: mapView];
}
Everytime the button hooked up to leak is pushed, a new instance of MKTileView gets leaked.
I'm using ARC. I've looked at the other questions, but none seem to mention the same leaks that I'm seeing here.
Any ideas what my problem might be?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论