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
Notes: blender-bot 2023-06-12 00:52:52 +02:00
Referenced by issue #39848, 'Reroute' from 'Layout' in compositor causes no output from viewer
Referenced by issue #39803, Segmentation fault in ColorIO on startup
Referenced by issue #39808, UV Map node not fully working
3 changed files with 7 additions and 0 deletions

View File

@ -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;
}

View File

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

View File

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