Intermittent crash in recordingCallback() on app launch

一世执手 提交于 2019-12-01 14:42:27

Read the stack trace and go where it tells you.

#0  0x00008ff2 in Gameplay::listen() at /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/include/c++/4.2.1/bits/basic_string.h:238

In my copy of that file, that code reads as follows:

  void
  _M_dispose(const _Alloc& __a)
  {
#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
    if (__builtin_expect(this != &_S_empty_rep(), false))
#endif
      if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount,
                             -1) <= 0)
        //Line 238:
        _M_destroy(__a);
  }  // XXX MT

Looking elsewhere in the file, that method is called by basic_string's destructor to release the string's private storage (_M_rep()).

For Objective-C objects, a crash like that generally indicates that the object itself (in this case, the string) was trashed, usually by over-releasing it. But I don't know how applicable that is to C++ objects; a lot of things work differently in C++ vs. Objective-C.

We can probably tell you more if you show us the code for recordingCallback, making sure to include line 143 of that file (again, see the stack trace for why I'm pointing there).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!