Camera: fix bufferFreed callback object lifecycle issue
Make sure the callback object won't be freed in the middle
of callback execution.
Test: CTS + stress test
Bug: 63683767
Change-Id: I6fb1b754cadb3d499c1c246687d2f60d444d00bb
diff --git a/services/camera/libcameraservice/device3/Camera3StreamInterface.h b/services/camera/libcameraservice/device3/Camera3StreamInterface.h
index c695a10..0544a1b 100644
--- a/services/camera/libcameraservice/device3/Camera3StreamInterface.h
+++ b/services/camera/libcameraservice/device3/Camera3StreamInterface.h
@@ -298,7 +298,7 @@
* Client is responsible to keep the listener object alive throughout the lifecycle of this
* Camera3Stream.
*/
- virtual void setBufferFreedListener(Camera3StreamBufferFreedListener* listener) = 0;
+ virtual void setBufferFreedListener(wp<Camera3StreamBufferFreedListener> listener) = 0;
};
} // namespace camera3