Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
478 views
in Technique[技术] by (71.8m points)

ios - Instruments show leak in main.m (Xcode 4.3.1)

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?

This is the stack trace

   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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It seems to be a bug in the iOS 5.1 framework: https://devforums.apple.com/message/630695


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...