aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--tensorflow/core/kernels/data/iterator_ops.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/core/kernels/data/iterator_ops.cc b/tensorflow/core/kernels/data/iterator_ops.cc
index f5db97fd59..a2f6c5fe2c 100644
--- a/tensorflow/core/kernels/data/iterator_ops.cc
+++ b/tensorflow/core/kernels/data/iterator_ops.cc
@@ -584,9 +584,9 @@ class MakeIteratorOp : public OpKernel {
IteratorResource* iterator_resource;
OP_REQUIRES_OK(
ctx, LookupResource(ctx, HandleFromInput(ctx, 1), &iterator_resource));
+ core::ScopedUnref unref(iterator_resource);
OP_REQUIRES_OK(ctx, iterator_resource->set_iterator(
dataset->MakeIterator("Iterator")));
- iterator_resource->Unref();
}
};