aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/util
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-08-09 15:09:48 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-09 15:17:34 -0700
commit65810b97ada2d5812df3e6f6d71b5dc6251efc0e (patch)
tree7b5a84a06d7dac1a82053e010a6eda8abb964b30 /tensorflow/core/util
parent9e5157c9340def527ba5eeff293c5f183cdbbfc0 (diff)
Change EventsWriter reset order so that file_ is still available when recordio_writer_ is destructed
PiperOrigin-RevId: 208118568
Diffstat (limited to 'tensorflow/core/util')
-rw-r--r--tensorflow/core/util/events_writer.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/tensorflow/core/util/events_writer.cc b/tensorflow/core/util/events_writer.cc
index c50e329bda..aaaba913a7 100644
--- a/tensorflow/core/util/events_writer.cc
+++ b/tensorflow/core/util/events_writer.cc
@@ -69,6 +69,10 @@ Status EventsWriter::InitIfNeeded() {
static_cast<int64>(time_in_seconds),
port::Hostname().c_str(), file_suffix_.c_str());
+ // Reset recordio_writer (which has a reference to recordio_file_) so final
+ // Flush() and Close() call have access to recordio_file_.
+ recordio_writer_.reset();
+
TF_RETURN_WITH_CONTEXT_IF_ERROR(
env_->NewWritableFile(filename_, &recordio_file_),
"Creating writable file ", filename_);