Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/12077


Change subject: radioInterface: Fix memleak during close()
......................................................................

radioInterface: Fix memleak during close()

destructors of pointers created through "new" must be destroyed manually
through "delete".

Change-Id: I10d37579f16bec89cc762f200a8951218305c708
---
M Transceiver52M/radioInterface.cpp
1 file changed, 8 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/77/12077/1

diff --git a/Transceiver52M/radioInterface.cpp 
b/Transceiver52M/radioInterface.cpp
index 6245cfc..f488b0d 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -75,6 +75,14 @@

 void RadioInterface::close()
 {
+  for (std::vector<RadioBuffer*>::iterator it = sendBuffer.begin(); it != 
sendBuffer.end(); ++it)
+          delete *it;
+  for (std::vector<RadioBuffer*>::iterator it = recvBuffer.begin(); it != 
recvBuffer.end(); ++it)
+          delete *it;
+  for (std::vector<short*>::iterator it = convertSendBuffer.begin(); it != 
convertSendBuffer.end(); ++it)
+          delete[] *it;
+  for (std::vector<short*>::iterator it = convertRecvBuffer.begin(); it != 
convertRecvBuffer.end(); ++it)
+          delete[] *it;
   sendBuffer.resize(0);
   recvBuffer.resize(0);
   convertSendBuffer.resize(0);

--
To view, visit https://gerrit.osmocom.org/12077
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I10d37579f16bec89cc762f200a8951218305c708
Gerrit-Change-Number: 12077
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <[email protected]>

Reply via email to