title: Crash after unwind segue due to location manager
body: <p>I have several viewcontrollers which unwind to the root viewcontroller. With most of the viewcontrollers the unwind segue works well without crashing the app. Only the viewcontrollers using a CLlocationmanager cannot perform the unwind segue to the root viewcontroller. These are the lines which makes the difference in my code:</p>
  
  <pre><code>//Init the location Manager
  locationManager = [[CLLocationManager alloc] init];
  [locationManager requestWhenInUseAuthorization];
  locationManager.distanceFilter = kCLDistanceFilterNone;
  locationManager.desiredAccuracy = kCLLocationAccuracyBest;
  [locationManager startUpdatingLocation];
  locationManager.delegate = self;
  </code></pre>
  
  <p>By commenting this section of my code the unwind works. Especially the last line makes the difference. I tried to release the locationmanager before unwinding. Sometimes it works. Somtimes it doesn`t. The debug console says:</p>
  
  <pre><code>0x10bfe1005:  movq   (%rdi), %r11
  0x10bfe1008:  movq   %rsi, %r10
  0x10bfe100b:  andl   0x18(%r11), %r10d&lt;---Thread 1: EXC Bad_Access(code=1, adress=0x18)
  0x10bfe100f:  shlq   $0x4, %r10
  0x10bfe1013:  addq   0x10(%r11), %r10
  </code></pre>
  
  <p>Whatever that means. I have no idea what to do.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>After adding this </p>
  
  <pre><code>-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
  [locationManager stopUpdatingLocation];
  [locationManager release];
  }
  </code></pre>
  
  <p>it kind of works. I tried it like 5 times. Then it crashed again :( Really strange. Not sure but the error message seems to have changed. It says "WebThread" (seen below). I do have a webview which also has delegate methods. I´ll try to release the webview as well.</p>
  
  <pre><code>libobjc.A.dylib`objc_msgSend:
  0x32f9af60:  cbz    r0, 0x32f9af9e            ; objc_msgSend + 62
  0x32f9af62:  ldr.w  r9, [r0]
  0x32f9af66:  ldrh.w r12, [r9, #12]  &lt;-----WebThread(10):EXC_bad_access(code=1, address=0x100000c)
  0x32f9af6a:  ldr.w  r9, [r9, #8]
  0x32f9af6e:  and.w  r12, r12, r1
  0x32f9af72:  add.w  r9, r9, r12, lsl #3
  
  0x32f9af76:  ldr.w  r12, [r9]
  0x32f9af7a:  teq.w  r12, r1
  0x32f9af7e:  bne    0x32f9af86                ; objc_msgSend + 38
  0x32f9af80:  ldr.w  r12, [r9, #4]
  0x32f9af84:  bx     r12
  0x32f9af86:  cmp.w  r12, #0x1
  0x32f9af8a:  blo    0x32f9af98                ; objc_msgSend + 56
  0x32f9af8c:  it     eq
  0x32f9af8e:  ldreq.w r9, [r9, #4]
  0x32f9af92:  ldr    r12, [r9, #8]!
  0x32f9af96:  b      0x32f9af7a                ; objc_msgSend + 26
  0x32f9af98:  ldr.w  r9, [r0]
  0x32f9af9c:  b      0x32f9b1e0                ; _objc_msgSend_uncached
  0x32f9af9e:  mov.w  r1, #0x0
  0x32f9afa2:  bx     lr
  0x32f9afa4:  nop    
  0x32f9afa6:  nop    
  0x32f9afa8:  nop    
  0x32f9afaa:  nop    
  0x32f9afac:  nop    
  0x32f9afae:  nop    
  0x32f9afb0:  nop    
  0x32f9afb2:  nop    
  0x32f9afb4:  nop    
  0x32f9afb6:  nop    
  0x32f9afb8:  nop    
  0x32f9afba:  nop    
  0x32f9afbc:  nop    
  0x32f9afbe:  nop    
  </code></pre>
  
  <p><strong>EDIT2</strong></p>
  
  <p>Ok, after releasing the location manager and the webview in the prepareforsegue method it works.</p>