Resolved cppcheck warnings in OutputDS.cpp

This commit is contained in:
Matthew Budd 2020-06-15 21:48:32 -04:00
parent 8490dd9800
commit ce03bf18e7
1 changed files with 6 additions and 3 deletions

View File

@ -145,12 +145,14 @@ public:
class ThreadData {
public:
ThreadData() { kill = dead = false; }
ThreadData() { ds = NULL; kill = dead = false; }
OAKRA_Module_OutputDS *ds;
bool kill,dead;
};
OAKRA_Module_OutputDS::OAKRA_Module_OutputDS() {
OAKRA_Module_OutputDS::OAKRA_Module_OutputDS()
{
threadData = NULL;
data = new Data();
((Data *)data)->global = false;
InitializeCriticalSection(&((Data *)data)->criticalSection);
@ -179,6 +181,7 @@ OAKRA_Voice *OAKRA_Module_OutputDS::getVoice(OAKRA_Format &format, OAKRA_Module
if(dsv->dead)
{
delete dsv;
dsv = 0;
}
else
{
@ -214,7 +217,7 @@ void OAKRA_Module_OutputDS::freeVoiceInternal(OAKRA_Voice *voice, bool internal)
if(!internal)
{
delete voice;
voice = 0;
//voice = 0; // Assignment of function parameter has no effect outside the function, commenting out to avoid cppcheck warning
}
unlock();
}