title: C++ terminate called without an active exception (gdb)
body: <p>Using iOS 5.X
  Cpp 11
  Xcode</p>
  
  <p>I am trying to identify what is causing this error.
  It may be caused from destructor being called prior to a thread completing. </p>
  
  <p><pre><code>
  // default_delete</p>
  
  <pre><code>template &lt;class _Tp&gt;
  struct _LIBCPP_VISIBLE default_delete
  {
      _LIBCPP_INLINE_VISIBILITY default_delete() _NOEXCEPT {}
      template &lt;class _Up&gt;
      _LIBCPP_INLINE_VISIBILITY default_delete(const default_delete&lt;_Up&gt;&amp;,
           typename enable_if&lt;is_convertible&lt;_Up*, _Tp*&gt;::value&gt;::type* = 0) _NOEXCEPT {}
      _LIBCPP_INLINE_VISIBILITY void operator() (_Tp* __ptr) const _NOEXCEPT
      {
          static_assert(sizeof(_Tp) &gt; 0, "default_delete can not delete incomplete type"); 
          delete __ptr;
      }
  };
  </code></pre>
  
  <p></pre></code></p>
  
  <p>The stack trace is as follows:</p>
  
  <p><pre><code>
  stack trace</p>
  
  <pre><code>2013-01-28 13:50:33.704 CPP11AudioRecoClient[4633:5107] A task has completed. Map now contains 0 entries.
  terminate called without an active exception(gdb) bt
  
  #0  0x316e932c in __pthread_kill
  #1  0x33de620e in pthread_kill 
  #2  0x33ddf29e in abort 
  #3  0x36c6cf6a in abort_message 
  #4  0x36c6a35a in default_terminate
  #5  0x35237324 in _objc_terminate
  #6  0x31997c96 in std::terminate
  #7  0x319d3d18 in std::__1::thread::~thread ()
  #8  0x00076cce in std::__1::default_delete&lt;std::__1::thread&gt;::operator() () at /Volumes/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/memory:2512
  
  #9  0x319d3d18 in std::__1::thread::~thread ()
  #10 0x319d3d18 in std::__1::thread::~thread ()
  #11 0x319c94cc in std::__1::__shared_weak_count::__release_shared ()
  #12 0x00077606 in std::__1::shared_ptr&lt;std::__1::thread&gt;::~shared_ptr (this=0x2d64c4) at memory:4441
  #13 0x0007676c in std::__1::shared_ptr&lt;std::__1::thread&gt;::~shared_ptr (this=0x2d64c4) at memory:4439
  #14 0x00076038 in Microsoft::BingMobile::MusicReco::ClientSDK::Cpp11Thread::~Cpp11Thread (this=0x2d64c0) at /Users/v-mattkn/Desktop/CPP11AudioRecoClient/Cpp11ThreadFactory.cpp:125
  #15 0x00075ffc in Microsoft::BingMobile::MusicReco::ClientSDK::Cpp11Thread::~Cpp11Thread (this=0x2d64c0) at /Users/v-mattkn/Desktop/CPP11AudioRecoClient/Cpp11ThreadFactory.cpp:123
  #16 0x00075fdc in Microsoft::BingMobile::MusicReco::ClientSDK::Cpp11Thread::~Cpp11Thread (this=0x2d64c0) at /Users/v-mattkn/Desktop/CPP11AudioRecoClient/Cpp11ThreadFactory.cpp:123
  #17 0x00077f68 in std::__1::default_delete&lt;Microsoft::BingMobile::MusicReco::ClientSDK::Cpp11Thread&gt;::operator() () at /Volumes/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/memory:2512
  #18 0x00077f68 in std::__1::__shared_ptr_pointer&lt;Microsoft::BingMobile::MusicReco::ClientSDK::Cpp11Thread*, std::__1::default_delete&lt;Microsoft::BingMobile::MusicReco::ClientSDK::Cpp11Thread&gt;, std::__1::allocator&lt;Microsoft::BingMobile::MusicReco::ClientSDK::Cpp11Thread&gt; &gt;::__on_zero_shared (this=0x2d5280) at memory:3668
  #19 0x319c94cc in std::__1::__shared_weak_count::__release_shared ()
  #20 0x0006a86e in std::__1::shared_ptr&lt;Microsoft::BingMobile::MusicReco::ClientSDK::IThread&gt;::~shared_ptr (this=0x2d6478) at memory:4441
  #21 0x00069d94 in std::__1::shared_ptr&lt;Microsoft::BingMobile::MusicReco::ClientSDK::IThread&gt;::~shared_ptr (this=0x2d6478) at memory:4439
  #22 0x00068d56 in Microsoft::BingMobile::MusicReco::ClientSDK::AsyncTask::~AsyncTask (this=0x2d6460) at /Users/v-mattkn/Desktop/CPP11AudioRecoClient/AsyncTask.cpp:34
  #23 0x00068ce8 in Microsoft::BingMobile::MusicReco::ClientSDK::AsyncTask::~AsyncTask (this=0x2d6460) at /Users/v-mattkn/Desktop/CPP11AudioRecoClient/AsyncTask.cpp:33
  #24 0x00068cc8 in Microsoft::BingMobile::MusicReco::ClientSDK::AsyncTask::~AsyncTask (this=0x2d6460) at /Users/v-mattkn/Desktop/CPP11AudioRecoClient/AsyncTask.cpp:33
  #25 0x0006ad08 in std::__1::default_delete&lt;Microsoft::BingMobile::MusicReco::ClientSDK::AsyncTask&gt;::operator() () at /Volumes/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/memory:2512
  #26 0x0006ad08 in std::__1::__shared_ptr_pointer&lt;Microsoft::BingMobile::MusicReco::ClientSDK::AsyncTask*, std::__1::default_delete&lt;Microsoft::BingMobile::MusicReco::ClientSDK::AsyncTask&gt;, std::__1::allocator&lt;Microsoft::BingMobile::MusicReco::ClientSDK::AsyncTask&gt; &gt;::__on_zero_shared (this=0x2d6090) at memory:3668
  #27 0x319c94cc in std::__1::__shared_weak_count::__release_shared ()
  #28 0x00069fca in std::__1::shared_ptr&lt;Microsoft::BingMobile::MusicReco::ClientSDK::ITaskObserver&gt;::~shared_ptr (this=0x44fb4fc) at memory:4441
  #29 0x00069e6c in std::__1::shared_ptr&lt;Microsoft::BingMobile::MusicReco::ClientSDK::ITaskObserver&gt;::~shared_ptr (this=0x44fb4fc) at memory:4439
  #30 0x00099c22 in Microsoft::BingMobile::MusicReco::ClientSDK::RunnableTaskBase::notifyObserver (this=0x2d6350, observerWeak=&lt;value temporarily unavailable, due to optimizations&gt;, sharedReferenceToSelf=@0x44fb638) at /Users/v-mattkn/Desktop/CPP11AudioRecoClient/RunnableTaskBase.cpp:100
  #31 0x00099930 in Microsoft::BingMobile::MusicReco::ClientSDK::RunnableTaskBase::notifyObservers (this=0x2d6350, sharedReferenceToSelf=&lt;value temporarily unavailable, due to optimizations&gt;) at /Users/v-mattkn/Desktop/CPP11AudioRecoClient/RunnableTaskBase.cpp:79
  #32 0x000996e0 in Microsoft::BingMobile::MusicReco::ClientSDK::RunnableTaskBase::setStatus (this=0x2d6350, targetStatus=Microsoft::BingMobile::MusicReco::ClientSDK::Completed, sharedReferenceToSelf=@0x44fbd20) at /Users/v-mattkn/Desktop/CPP11AudioRecoClient/RunnableTaskBase.cpp:107
  #33 0x00087168 in Microsoft::BingMobile::MusicReco::ClientSDK::PingWebServiceTask::runTaskChecked (this=0x2d6350, sharedReferenceToSelf=&lt;value temporarily unavailable, due to optimizations&gt;) at /Users/v-mattkn/Desktop/CPP11AudioRecoClient/PingWebServiceTask.cpp:120
  #34 0x00099356 in Microsoft::BingMobile::MusicReco::ClientSDK::RunnableTaskBase::runTask (this=0x2d6350) at /Users/v-mattkn/Desktop/CPP11AudioRecoClient/RunnableTaskBase.cpp:60
  #35 0x000991d2 in Microsoft::BingMobile::MusicReco::ClientSDK::RunnableTaskBase::run (this=0x2d6350, sharedReferenceToSelf=&lt;value temporarily unavailable, due to optimizations&gt;) at /Users/v-mattkn/Desktop/CPP11AudioRecoClient/RunnableTaskBase.cpp:48
  #36 0x00099250 in non-virtual thunk to Microsoft::BingMobile::MusicReco::ClientSDK::RunnableTaskBase::run(std::__1::shared_ptr&lt;Microsoft::BingMobile::MusicReco::ClientSDK::IRunnable&gt;) () at memory:4023
  #37 0x000759ca in Microsoft::BingMobile::MusicReco::ClientSDK::RunHookedRunnable::run (this=0x2d64a0, sharedReferenceToSelf=@0x44fcea8) at /Users/v-mattkn/Desktop/CPP11AudioRecoClient/Cpp11ThreadFactory.cpp:75
  #38 0x0007736e in _ZNKSt3__110unique_ptrINS_5tupleIJMN9Microsoft10BingMobile9MusicReco9ClientSDK9IRunnableEFvNS_10shared_ptrIS6_EEES8_S8_EEENS_14default_deleteISB_EEEdeEv [inlined] () at /Volumes/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/memory:309
  #39 0x0007736e in _ZNSt3__114__thread_proxyINS_5tupleIJMN9Microsoft10BingMobile9MusicReco9ClientSDK9IRunnableEFvNS_10shared_ptrIS6_EEES8_S8_EEEEEPvSC_ (__vp=0x2d6230) at __functional_base:340
  </code></pre>
  
  <h1>40 0x33da7734 in _pthread_start ()</h1>
  
  <p></pre></code></p>