BGE: Fixing memory leaks when deactivating Sensors, Controllers, or actuators.

Found by Coverity and confirmed with Valgrind.
This commit is contained in:
Mitchell Stokes 2014-04-19 14:51:29 -07:00
parent a51a0ca772
commit b4cb467359
3 changed files with 7 additions and 0 deletions

@ -1122,6 +1122,8 @@ void BL_ConvertActuators(const char* maggiename,
// done with baseact, release it
baseact->Release();
}
else if (baseact)
baseact->Release();
bact = bact->next;
}

@ -240,6 +240,8 @@ void BL_ConvertControllers(
//done with gamecontroller
gamecontroller->Release();
}
else if (gamecontroller)
gamecontroller->Release();
bcontr = bcontr->next;
}

@ -640,6 +640,9 @@ void BL_ConvertSensors(struct Object* blenderobject,
gamesensor->Release();
}
else if (gamesensor)
gamesensor->Release();
sens=sens->next;
}
}