Declare ownership of native_handle_t object
Change-Id: I4e21ff8ea76cfafce943dc059c8f72b42397980e
diff --git a/libs/gui/IGraphicBufferConsumer.cpp b/libs/gui/IGraphicBufferConsumer.cpp
index 3598a86..d3dffdd 100644
--- a/libs/gui/IGraphicBufferConsumer.cpp
+++ b/libs/gui/IGraphicBufferConsumer.cpp
@@ -392,7 +392,7 @@
}
sp<NativeHandle> stream;
if (reply.readInt32()) {
- stream = NativeHandle::create(reply.readNativeHandle());
+ stream = NativeHandle::create(reply.readNativeHandle(), true);
}
return stream;
}
diff --git a/libs/gui/IGraphicBufferProducer.cpp b/libs/gui/IGraphicBufferProducer.cpp
index 1d4ec1c..7c50315 100644
--- a/libs/gui/IGraphicBufferProducer.cpp
+++ b/libs/gui/IGraphicBufferProducer.cpp
@@ -329,7 +329,7 @@
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
sp<NativeHandle> stream;
if (data.readInt32()) {
- stream = NativeHandle::create(data.readNativeHandle());
+ stream = NativeHandle::create(data.readNativeHandle(), true);
}
status_t result = setSidebandStream(stream);
reply->writeInt32(result);