Camera: Fix memory leak while exiting camera application
Fix the memory leak that occurs while exiting the camera application by
flushing the busy and free queues in stop preview.
diff --git a/QualcommCameraHardware.cpp b/QualcommCameraHardware.cpp
index ce6fc36..fb8d9c0 100644
--- a/QualcommCameraHardware.cpp
+++ b/QualcommCameraHardware.cpp
@@ -2516,6 +2516,10 @@
pthread_mutex_lock(&(g_busy_frame_queue.mut));
pthread_cond_signal(&(g_busy_frame_queue.wait));
pthread_mutex_unlock(&(g_busy_frame_queue.mut));
+ /* Flush the Busy Q */
+ cam_frame_flush_video();
+ /* Flush the Free Q */
+ LINK_cam_frame_flush_free_video();
}
mPreviewInitialized = false;
}