RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
1.01k stars 178 forks source link

Fixed memory leaks in message loop processing (main.cpp). #3026

Closed ohlidalp closed 1 year ago

ohlidalp commented 1 year ago

Most of them were edge cases, such as ACTOR_SPAWN request outside of simulation, but nonetheless it's a good practice to always delete allocated memory.

Also the coding style was unified - all the case blocks now use static_cast<WhateverDataType*>(m.payload) for type conversion and are formatted case ABC: { /*profit*/ break; }.

Also, I cherry picked some build-fixing commits from other branches; building without scripting, audio or networking will not fail anymore.