diff --git a/simgear/io/SGDataDistributionService.cxx b/simgear/io/SGDataDistributionService.cxx index 85b6ce7d..c0af7f65 100644 --- a/simgear/io/SGDataDistributionService.cxx +++ b/simgear/io/SGDataDistributionService.cxx @@ -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(); diff --git a/simgear/io/SGDataDistributionService.hxx b/simgear/io/SGDataDistributionService.hxx index a2d9fc72..7e38471d 100644 --- a/simgear/io/SGDataDistributionService.hxx +++ b/simgear/io/SGDataDistributionService.hxx @@ -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.