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.
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.