ошибка, найденная с Windbg: < /p>
Код: Выделить всё
(d388.271c): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=00000000 ebx=0c63a9f8 ecx=00000000 edx=00000000 esi=0c63aba8 edi=0c63a9f8
eip=656011ca esp=0d2cff04 ebp=0d2cff1c iopl=0 nv up ei pl zr na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246
GMvorbis!gmvorbis_update_audio_queues+0x3a:
656011ca 8b0490 mov eax,dword ptr [eax+edx*4] ds:002b:00000000=????????
< /code>
Функция потока: < /p>
void gmvorbis_update_audio_queues() {
while (true) {
if (need_filled != nullptr && !need_filled->empty()) {
int val = need_filled->front(); // this line is highlighted as the one causing the error by WinDbg
need_filled->pop_front();
files[val].buffer_mutex->lock();
stb_vorbis_get_samples_short_interleaved(files[val].vorbis, 2, files[val].buffer + (2048 * files[val].filled++), 2048);
files[val].buffer_mutex->unlock();
}
}
}
< /code>
Функция init Создание потока: < /p>
GMEXPORT double gmvorbis_init() {
need_filled = new std::deque();
loading_thread = std::thread(gmvorbis_update_audio_queues);
return 0;
}
< /code>
Я законно не могу увидеть, в чем может быть проблема. По -видимому, эта ошибка вызвана чтением неверного адреса. Я предполагаю, что каким -то образом функция deque.empty ()
Подробнее здесь: https://stackoverflow.com/questions/796 ... id-address