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

View File

@ -274,10 +274,10 @@ bool
SG_DDS::close()
{
for (auto it : readers)
it->close();
delete it;
for (auto it : writers)
it->close();
delete it;
readers.clear();
writers.clear();

View File

@ -67,7 +67,7 @@ public:
}
/** Destructor */
~SG_DDS_Topic();
virtual ~SG_DDS_Topic();
// Set the paramaters which weren't available at creation time and use
// a custom topic name.