- fix possible crash in conc (but it's still an ugly hack)
- fix noob usage of strcmp
- flag some memory leaks (it would be nice, if the author(s) would clean
   up the mess himself)
- fix crash in substr
- whitespace cleanup

there are plenty more memory leaks in command.cpp - for example, every
goto in cubescript does not clean up anything
This commit is contained in:
ac-stef
2014-05-14 22:54:37 +02:00
parent 5058172a06
commit eb60302e67
57 changed files with 246 additions and 254 deletions
+8 -8
View File
@@ -61,7 +61,7 @@ void sourcescheduler::reset()
source *sourcescheduler::newsource(int priority, const vec &o)
{
if(!sources.length())
if(!sources.length())
{
DEBUG("empty source collection");
return NULL;
@@ -72,9 +72,9 @@ source *sourcescheduler::newsource(int priority, const vec &o)
// reserve some sources for sounds of higher priority
int reserved = (SP_HIGHEST-priority)*soundschedreserve;
DEBUGVAR(reserved);
// search unused source
loopv(sources)
loopv(sources)
{
if(!sources[i]->locked && reserved--<=0)
{
@@ -84,7 +84,7 @@ source *sourcescheduler::newsource(int priority, const vec &o)
}
}
if(!src)
if(!src)
{
DEBUG("no empty source found");
@@ -108,7 +108,7 @@ source *sourcescheduler::newsource(int priority, const vec &o)
{
source *s = sources[i];
if(s->priority==SP_HIGHEST) continue; // highest priority sounds can't be replaced
const vec & otherpos = s->position();
float otherdist = otherpos.iszero() ? 0.0f : camera1->o.dist(otherpos);
float otherscore = (s->priority*soundschedpriorityscore) - (otherdist*soundscheddistancescore) + soundschedoldbonus;
@@ -128,7 +128,7 @@ source *sourcescheduler::newsource(int priority, const vec &o)
}
}
if(!src)
if(!src)
{
DEBUG("sound aborted, no channel takeover possible");
return NULL;
@@ -147,9 +147,9 @@ void sourcescheduler::releasesource(source *src)
ASSERT(src->locked); // detect double release
if(!src) return;
DEBUG("unlocking source");
src->unlock();
if(sources.length() > numsoundchannels)