std::event memory leak fixed