仪器在 main.m (Xcode 4.3.1) 中显示泄漏 [英] Instruments show leak in main.m (Xcode 4.3.1)
本文介绍了仪器在 main.m (Xcode 4.3.1) 中显示泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 ARC 开发应用程序在检测内存泄漏的仪器中分析我的应用程序时,它会在以下函数中显示泄漏:
I am developing an app using ARC When profiling my app in instruments for memory leaks it shows leaks at the following function:
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
这是否表明我的代码中的其他地方有问题?
Does this indicate a problem somewhere else in my code?
这是堆栈跟踪
0 libsystem_c.dylib malloc
1 libsystem_c.dylib strdup
2 libnotify_sim.dylib token_table_add
3 libnotify_sim.dylib notify_register_mach_port
4 libnotify_sim.dylib notify_register_dispatch
5 CoreFoundation _CFXNotificationRegisterObserver
6 CoreFoundation CFNotificationCenterAddObserver
7 UIKit -[UIScrollView(Static) _startTimer:]
8 UIKit -[UIScrollView _endPanWithEvent:]
9 UIKit -[UIScrollView handlePan:]
10 UIKit _UIGestureRecognizerSendActions
11 UIKit -[UIGestureRecognizer _updateGestureWithEvent:]
12 UIKit -[UIGestureRecognizer _delayedUpdateGesture]
13 UIKit ___UIGestureRecognizerUpdate_block_invoke_0541
14 UIKit _UIGestureRecognizerApplyBlocksToArray
15 UIKit _UIGestureRecognizerUpdate
16 UIKit -[UIWindow _sendGesturesForEvent:]
17 UIKit -[UIWindow sendEvent:]
18 UIKit -[UIApplication sendEvent:]
19 UIKit _UIApplicationHandleEvent
20 GraphicsServices PurpleEventCallback
21 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
22 CoreFoundation __CFRunLoopDoSource1
23 CoreFoundation __CFRunLoopRun
24 CoreFoundation CFRunLoopRunSpecific
25 CoreFoundation CFRunLoopRunInMode
26 GraphicsServices GSEventRunModal
27 GraphicsServices GSEventRun
28 UIKit UIApplicationMain
29 MyProject/main.m:16
30 MyProject start
推荐答案
貌似是iOS 5.1框架的一个bug:https://devforums.apple.com/message/630695
It seems to be a bug in the iOS 5.1 framework: https://devforums.apple.com/message/630695
这篇关于仪器在 main.m (Xcode 4.3.1) 中显示泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文