title: Object overreleased while already deallocating; break on objc_overrelease_during_dealloc_error to debug
body: <p>I am using strong <code>IBOutlet</code> to custom <code>PDFView</code> in <code>NSViewController</code> subclass but I am getting crash on 10.11 after switching view controller. Everything is working fine on 10.8,10.9 and 10.10. I am using ARC.</p>
  
  <pre><code>self.activeRootViewController = controller;
  self.backgroundWindow.contentView = controller.view;
  
  @property (strong) IBOutlet MYPDFView* pdfView; // property inside NSViewController subclass.
  </code></pre>
  
  <blockquote>
    <p>MYPDFView object 0x10ac1bc50 overreleased while already deallocating;
    break on objc_overrelease_during_dealloc_error to debug</p>
  </blockquote>
  
  <p>I have added breakpoint on <code>objc_overrelease_during_dealloc_error</code> but unable to solve this issue.</p>
  
  <p>Can anyone please help me out?</p>
  
  <p><code>dealloc</code> method MYPDFView is getting called only once.</p>
  
  <p>Backtrace from lldb:</p>
  
  <pre><code>objc[23395]: MYPDFView object 0x10ac1bc50 overreleased while already deallocating; break on objc_overrelease_during_dealloc_error to debug
  Process 23395 stopped
  * thread #1: tid = 0x11b04b, 0x00007fff926bcb1c libobjc.A.dylib`objc_overrelease_during_dealloc_error, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 2.1
      frame #0: 0x00007fff926bcb1c libobjc.A.dylib`objc_overrelease_during_dealloc_error
  libobjc.A.dylib`objc_overrelease_during_dealloc_error:
  -&gt;  0x7fff926bcb1c &lt;+0&gt;: retq   
      0x7fff926bcb1d &lt;+1&gt;: nop    
  
  libobjc.A.dylib`objc_object::sidetable_lock:
      0x7fff926bcb1e &lt;+0&gt;: movl   %edi, %eax
      0x7fff926bcb20 &lt;+2&gt;: shrl   $0x9, %eax
  (lldb) bt
  * thread #1: tid = 0x11b04b, 0x00007fff926bcb1c libobjc.A.dylib`objc_overrelease_during_dealloc_error, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 2.1
    * frame #0: 0x00007fff926bcb1c libobjc.A.dylib`objc_overrelease_during_dealloc_error
      frame #1: 0x00007fff926bd78a libobjc.A.dylib`objc_object::overrelease_error() + 42
      frame #2: 0x00007fff9ad13102 AppKit`-[NSImmediateActionGestureRecognizer dealloc] + 42
      frame #3: 0x00007fff9702ce3c CoreFoundation`-[__NSArrayM removeAllObjects] + 252
      frame #4: 0x00007fff9a426caf AppKit`-[NSView removeAllGestureRecognizers] + 294
      frame #5: 0x00007fff9a4257b3 AppKit`-[NSView _finalizeWithReferenceCounting] + 1333
      frame #6: 0x00007fff9a425256 AppKit`-[NSView dealloc] + 151
      frame #7: 0x00007fff906ef366 PDFKit`-[PDFView dealloc] + 834
      frame #8: 0x000000010003236d MYApp`-[MYPDFView dealloc] + 125
      frame #9: 0x00007fff926a6094 libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 476
      frame #10: 0x00007fff96fc7a72 CoreFoundation`_CFAutoreleasePoolPop + 50
      frame #11: 0x00007fff9c7f30fe Foundation`__NSFireDelayedPerform + 441
      frame #12: 0x00007fff970119f4 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
      frame #13: 0x00007fff97011683 CoreFoundation`__CFRunLoopDoTimer + 1075
      frame #14: 0x00007fff970111da CoreFoundation`__CFRunLoopDoTimers + 298
      frame #15: 0x00007fff970086d1 CoreFoundation`__CFRunLoopRun + 1841
      frame #16: 0x00007fff97007d38 CoreFoundation`CFRunLoopRunSpecific + 296
      frame #17: 0x00007fff9517dd55 HIToolbox`RunCurrentEventLoopInMode + 235
      frame #18: 0x00007fff9517da97 HIToolbox`ReceiveNextEventCommon + 184
      frame #19: 0x00007fff9517d9cf HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 71
      frame #20: 0x00007fff9a433f3a AppKit`_DPSNextEvent + 1067
      frame #21: 0x00007fff9a433369 AppKit`-[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
      frame #22: 0x00007fff9a427ecc AppKit`-[NSApplication run] + 682
      frame #23: 0x00007fff9a3f1162 AppKit`NSApplicationMain + 1176
      frame #24: 0x0000000100003452 MYApp`main + 34
      frame #25: 0x00007fff8eecc5ad libdyld.dylib`start + 1
      frame #26: 0x00007fff8eecc5ad libdyld.dylib`start + 1
  (lldb) 
  </code></pre>