diff --git a/paddle/fluid/operators/reader/create_double_buffer_reader_op.cc b/paddle/fluid/operators/reader/create_double_buffer_reader_op.cc index 7b14370f4fd64e8fd5b8d9038006494b88d671dc..f3c0deb19fe674b48d5bf7a94d8cafd64cee14e2 100644 --- a/paddle/fluid/operators/reader/create_double_buffer_reader_op.cc +++ b/paddle/fluid/operators/reader/create_double_buffer_reader_op.cc @@ -52,12 +52,10 @@ class DoubleBufferReader : public framework::DecoratedReader { void ReadNextImpl(std::vector* out) override; - ~DoubleBufferReader() { EndPrefetcher(); } - private: void ShutdownImpl() override { - EndPrefetcher(); reader_->Shutdown(); + EndPrefetcher(); } void StartImpl() override { diff --git a/paddle/fluid/operators/reader/create_shuffle_reader_op.cc b/paddle/fluid/operators/reader/create_shuffle_reader_op.cc index 4b308abc290c10a8a5846672e719b503dfc79b21..3f72890a7cee1453585d50afa04fa62a9b059dc3 100644 --- a/paddle/fluid/operators/reader/create_shuffle_reader_op.cc +++ b/paddle/fluid/operators/reader/create_shuffle_reader_op.cc @@ -48,9 +48,9 @@ class ShuffleReader : public framework::DecoratedReader { private: void ShutdownImpl() override { + reader_->Shutdown(); buffer_.clear(); iteration_pos_ = 0; - reader_->Shutdown(); } void StartImpl() override { diff --git a/paddle/fluid/operators/reader/open_files_op.cc b/paddle/fluid/operators/reader/open_files_op.cc index 9a8d203672fa2d560440d063d93fa5f8523690ef..51a00c0007ec8491e3e62ad79347353d5c0540af 100644 --- a/paddle/fluid/operators/reader/open_files_op.cc +++ b/paddle/fluid/operators/reader/open_files_op.cc @@ -36,8 +36,6 @@ class MultiFileReader : public framework::ReaderBase { void ReadNextImpl(std::vector* out) override; - ~MultiFileReader() { EndScheduler(); } - private: void ShutdownImpl() override { EndScheduler(); }