theomarzaki / TrafficOrchestrator

Traffic Orchestrator for Central unit Processing of autonomous vehicle merging through the use of Reinforcment Learning
MIT License
2 stars 0 forks source link

Memory leak on database #22

Closed wayglem closed 5 years ago

wayglem commented 5 years ago

When deleting an element in the database it's removed from the map but the object is not deleted which will cause quickly a huge memory leak. This is because we are using raw pointers in the unordered_map and it's tricky to delete. We should use the value directly (since the map can be seen as a pointer) or at least use a shared_ptr to have them handled by the smart pointer system.