vapi: avoid memory leak

Erase removed elements to avoid memory leaks.

Type: fix
Change-Id: I1605bea8df7e08455691364efb0a12eb0d9dae93
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
This commit is contained in:
Klement Sekera
2024-03-25 15:23:55 +01:00
committed by Ole Tr�an
parent f46c5525d2
commit 0f4febfac3

View File

@ -422,7 +422,7 @@ private:
void unregister_request (Common_req *request)
{
std::lock_guard<std::recursive_mutex> lock (requests_mutex);
std::remove (requests.begin (), requests.end (), request);
requests.erase (std::remove (requests.begin (), requests.end (), request));
}
template <typename M> void register_event (Event_registration<M> *event)