Delete the readers and writers (which closes them automatically) to prevent memory leaks.

This commit is contained in:
Erik Hofman
2021-03-29 11:41:12 +02:00
parent deb802f74a
commit e58ca605b6
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -274,10 +274,10 @@ bool
SG_DDS::close() SG_DDS::close()
{ {
for (auto it : readers) for (auto it : readers)
it->close(); delete it;
for (auto it : writers) for (auto it : writers)
it->close(); delete it;
readers.clear(); readers.clear();
writers.clear(); writers.clear();
+1 -1
View File
@@ -67,7 +67,7 @@ public:
} }
/** Destructor */ /** Destructor */
~SG_DDS_Topic(); virtual ~SG_DDS_Topic();
// Set the paramaters which weren't available at creation time and use // Set the paramaters which weren't available at creation time and use
// a custom topic name. // a custom topic name.