开发者

getting message just leaking memory

开发者 https://www.devze.com 2023-03-05 19:54 出处:网络
Hi friend i have message on console (it\'s not give error or warning )it only show message the message it\'s like that

Hi friend i have message on console (it's not give error or warning )it only show message the message it's like that

 __NSAutoreleaseNoPool(): Object 0x6378190 of class HGMapPath autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6379e00 of class HGMovingAnnotation autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x578f2e0 of class __NSCFSet autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790a00 of class __NSDate autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790ab0 of class __NSCFTimer autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6348c90 of class UIView autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x633fb60 of class UILayoutContainerView autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x6379c10 of class __NSArrayI autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790e20 of class MKDirectionsRouteInfo autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x6371a40 of class MKDirectionsRouteInfo autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x63799c0 of class NSCFString autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x6371e30 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x636d850 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790cf0 of class __NSArrayI autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d10 of class __NSArrayI autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790e90 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d30 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d40 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d50 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d60 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d70 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d80 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d90 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x6379b40 of class __NSArrayI autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x6375300 of class CABasicAnimation autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790b40 of class CABasicAnimation autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790ed0 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790ee0 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x634d210 of class CABasicAnimation autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x6379b60 of class CABasicAnimation autoreleased with no pool in place - just leakin开发者_JS百科g
 __NSAutoreleaseNoPool(): Object 0x637b870 of class __NSCFDictionary autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6371960 of class NSThread autoreleased with no pool in place - just leaking

I just want know why it is happening .Is that it create problem in future .And How can i solve

I am using this code please check it out And suggest me best way to solve this.

//start tracking vehicle locations. In DEMO mode just read locations from the path...
- (void) start
{
  [self performSelectorInBackground:@selector(startTracking) withObject:nil];
}

- (void) stop 
{
  [NSObject cancelPreviousPerformRequestsWithTarget:self];
  self.isMoving = NO;
}


- (void) startTracking
{
    self.isMoving = YES; 

    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

  for(int i=_currentPathPointIndex+1; i<path.pointCount; i++)
  {

    currentLocation = self.path.points[i]; 

    _distanceTravelled += MKMetersBetweenMapPoints(self.path.points[i], self.path.points[i-1]);

      //send notification
      [[NSNotificationCenter defaultCenter] postNotificationName:kObjectMovedNotification object:self]; 

      [NSThread sleepForTimeInterval : DEMO_SPEED];
  }

  //finished moving along the path - send notification
  [[NSNotificationCenter defaultCenter] postNotificationName:kObjectRechedEndOfPathNotification object:self]; 

  [pool drain];
}

Thanks in advance


When getting the "no pool in place error" set the debugger set environment variable NSAutoreleaseHaltOnNoPool to YES when the process launches. This will cause the debugger to break when one of those messages is emitted. At this point the callstack should help you figure out where you need to add the auto release pool.

The tidbit of information about NSAutoreleaseHaltOnNoPool and many other debug tools can be found in NSDebug.h.

0

精彩评论

暂无评论...
验证码 换一张
取 消