Ticket #577: diff-bug-snd_mgr-20-03-2011-alt.patch
File diff-bug-snd_mgr-20-03-2011-alt.patch, 1023 bytes (added by , 13 years ago) |
---|
-
source/lib/res/sound/snd_mgr.cpp
482 482 debug_assert(0); // list full (can't happen) 483 483 } 484 484 485 static voidsrcs_remove(volatile intptr_t* srcs, ALuint al_src)485 static bool srcs_remove(volatile intptr_t* srcs, ALuint al_src) 486 486 { 487 487 for(size_t i = 0; i < al_src_allocated; i++) 488 488 { 489 489 if(cpu_CAS(&srcs[i], (intptr_t)al_src, 0)) 490 return ;490 return true; 491 491 } 492 debug_assert(0); // source not found (can't happen) 492 return false; 493 //debug_assert(0); // source not found (can't happen) 493 494 } 494 495 495 496 // @return first nonzero entry (which is then zeroed), or zero if there are none. … … 585 586 static void al_src_free(ALuint al_src) 586 587 { 587 588 debug_assert(alIsSource(al_src)); 588 srcs_remove(al_srcs_used, al_src);589 srcs_insert(al_srcs_free, al_src);589 if (srcs_remove(al_srcs_used, al_src)) 590 srcs_insert(al_srcs_free, al_src); 590 591 } 591 592 592 593