diff options
author | Klement Sekera <klement.sekera@gmail.com> | 2024-03-25 15:23:55 +0100 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2024-04-02 06:55:01 +0000 |
commit | 0f4febfac3ed95a384778fc25e5223062acdf0a9 (patch) | |
tree | 52b00338cad17729925a282269500628ac8c4b29 /src | |
parent | f46c5525d22cfcfd785fea13b9c439db311a1606 (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/vpp-api/vapi/vapi.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vpp-api/vapi/vapi.hpp b/src/vpp-api/vapi/vapi.hpp index 109af9fc522..34d8f97ad89 100644 --- a/src/vpp-api/vapi/vapi.hpp +++ b/src/vpp-api/vapi/vapi.hpp @@ -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) |