Skip to content

Commit 13455ec

Browse files
authored
Add virtual destructors to classes with virtual functions and no declared destructor. (#1257)
1 parent f46d22a commit 13455ec

File tree

6 files changed

+13
-0
lines changed

6 files changed

+13
-0
lines changed

src/sst/core/eli/elementbuilder.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ struct Builder
2727

2828
template <class NewBase>
2929
using ChangeBase = Builder<NewBase, Args...>;
30+
31+
virtual ~Builder() = default;
3032
};
3133

3234
template <class Base, class... CtorArgs>

src/sst/core/link.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ class alignas(64) Link
111111
@param key Key that would be passed into the eventSent() function.
112112
*/
113113
virtual void serializeEventAttachPointKey(SST::Core::Serialization::serializer& ser, uintptr_t& key);
114+
115+
virtual ~AttachPoint() = default;
114116
};
115117

116118
friend class LinkPair;

src/sst/core/model/element_python.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ class SSTElementPythonModuleCode
117117
* \return full name of module as a string
118118
*/
119119
std::string getFullModuleName();
120+
121+
virtual ~SSTElementPythonModuleCode() = default;
120122
};
121123

122124
/**

src/sst/core/realtimeAction.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class RealTimeAction
3434

3535

3636
RealTimeAction();
37+
virtual ~RealTimeAction() = default;
3738

3839
/* Optional function called just before run loop starts. Passes in
3940
* the next scheduled time of the event or 0 if the event is not

src/sst/core/ssthandler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ class SSTHandlerBase<void, argT> : public SST::Core::Serialization::serializable
470470
virtual void
471471
serializeHandlerInterceptPointKey(SST::Core::Serialization::serializer& UNUSED(ser), uintptr_t& UNUSED(key))
472472
{}
473+
474+
virtual ~InterceptPoint() = default;
473475
};
474476

475477
private:

src/sst/core/statapi/statbase.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ struct StatisticCollector<T, true>
342342
addData_impl(data);
343343
}
344344
}
345+
346+
virtual ~StatisticCollector() = default;
345347
};
346348

347349
template <class... Args>
@@ -367,6 +369,8 @@ struct StatisticCollector<std::tuple<Args...>, false>
367369
{
368370
addData_impl(std::make_tuple(std::forward<InArgs>(args)...));
369371
}
372+
373+
virtual ~StatisticCollector() = default;
370374
};
371375

372376
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)