`erase(it)` just remove the pointer, it won't free the memory the pointer points to.

`delete pending_queue_` only delete the pointer points to the `map`, it can't fix the memory leak which already created in above.

Why don't just store objects instead of pointers in the queue? By that you don't have to manage memory by yourself.