Skip to content

Commit a736b60

Browse files
jakeh-gcgeorgepaw
authored andcommitted
Make ResultProcessorBase destructor virtual so that derived classes have their destructors called.
Summary: We create instances of `ResultProcessor` and `DummyResultProcessor`, but when they are destroyed they are pointers to `ResultProcessorBase`. The non-virtual default destructor means the derived class destructor was not being called, potentially leaking memory. Ref T57532 Reviewers: #tensorflow, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, vladimirm Reviewed By: #tensorflow, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, vladimirm Subscribers: vladimirm Maniphest Tasks: T57532 Differential Revision: https://phabricator.sourcevertex.net/D62514
1 parent 49844ea commit a736b60

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tensorflow/compiler/plugin/poplar/kernels/application_runtime/application_runtime.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ class IOConfig {
283283
// Base class which is used for processing the results from outfeed callbacks.
284284
class ResultProcessorBase {
285285
public:
286+
virtual ~ResultProcessorBase() = default;
287+
286288
// Returns whether all outputs have been processed.
287289
virtual bool ProcessOutput(const std::string& name, void* data) {
288290
// Check whether this is the last callback.

0 commit comments

Comments
 (0)