title: Core data executeFetchRequest fail with exc_bad_access
body: <p>From my understanding, this is a memory issue, especially since I call the method from several places several times with different timers.</p>
  
  <p>Code below that throw the exception:</p>
  
  <pre><code>- (NSMutableArray*)getAllTraps
  {
      @synchronized(self)
      {
          self.fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"Trap"];
          NSError *error = nil;
          NSArray *results = [self.managedObjectContext executeFetchRequest:self.fetchRequest error:&amp;error];
  
          if (!results)
          {
              NSLog(@"Error fetching traps: %@", error.localizedDescription);
              NSLog(@"Reason: %@", error.localizedFailureReason);
              NSLog(@"Suggestion: %@", error.localizedRecoverySuggestion);
              abort();
          }
  
  
          if (error != nil)
          {
              // Handle error
              NSLog(@"Error getting all traps");
          }
          else
          {
              // Handle success
              NSLog(@"Success getting all traps");
          }
  
  
          NSMutableArray *arrayOfAllTraps = [[NSMutableArray alloc] init];
          for (int i = 0; i &lt; results.count; i++)
          {
              Trap *singleTrap = results[i];
              NSMutableDictionary *singleDict = [[NSMutableDictionary alloc] init];
  
              if (singleTrap.trapID.integerValue &gt; 0)
              {
                  singleDict[ID] = singleTrap.trapID;
                  singleDict[ALARMDISTANCE] = singleTrap.alarmDistance;
                  singleDict[ISACTIVE] = singleTrap.isActive;
                  singleDict[LAT] = singleTrap.lat;
                  singleDict[LON] = singleTrap.lon;
                  singleDict[POLYGONS] = singleTrap.polys;
  
  
                  // NSLog(@"Trap ID: %@, Trap Description: %@", singleTrap.trapID, singleTrap.trapDescription);
                  singleDict[DESCRIPTION] = singleTrap.trapDescription;
  
  
                  singleDict[ROADNUMBER] = singleTrap.roadNumber;
                  singleDict[TYPE] = singleTrap.type;
                  singleDict[DEGREES] = singleTrap.degrees;
                  singleDict[DIRECTION] = singleTrap.direction;
  
  
                  if (singleTrap.poly0 == nil)
                  {
                      singleDict[POLYGON_A] = @"";
                  }
                  else
                  {
                      singleDict[POLYGON_A] = singleTrap.poly0;
                  }
  
                  // Make sure not to set NULL value #1
                  if (singleTrap.poly1 == nil)
                  {
                      singleDict[POLYGON_B] = @"";
                  }
                  else
                  {
                      singleDict[POLYGON_B] = singleTrap.poly1;
                  }
  
                  if (singleTrap.poly2 == nil)
                  {
                      singleDict[POLYGON_C] = @"";
                  }
                  else
                  {
                      singleDict[POLYGON_C] = singleTrap.poly2;
                  }
  
  
                  // Make sure not to set NULL value #2
                  if (singleTrap.polygonAzimut1 == nil)
                  {
                      singleDict[POLYGON_A_AZIMUTH] = @"";
                  }
                  else
                  {
                      singleDict[POLYGON_A_AZIMUTH] = singleTrap.polygonAzimut1;
                  }
  
                  if (singleTrap.polygonAzimut2 == nil)
                  {
                      singleDict[POLYGON_B_AZIMUTH] = @"";
                  }
                  else
                  {
                      singleDict[POLYGON_B_AZIMUTH] = singleTrap.polygonAzimut2;
                  }
  
                  if (singleTrap.polygonAzimut3 == nil)
                  {
                      singleDict[POLYGON_C_AZIMUTH] = @"";
                  }
                  else
                  {
                      singleDict[POLYGON_C_AZIMUTH] = singleTrap.polygonAzimut3;
                  }
  
                  [arrayOfAllTraps addObject:singleDict];
              }
          }
  
          return arrayOfAllTraps;
      }
  }
  </code></pre>
  
  <p>The fail come right after:</p>
  
  <pre><code>NSArray *results = [self.managedObjectContext executeFetchRequest:self.fetchRequest error:&amp;error];
  </code></pre>
  
  <p>And not even go inside 'if'.</p>