Release the camera in surfaceDestroyed().

If the camera is not released, the new client will fail to connect to camera next time. b2042350
This commit is contained in:
Wu-cheng Li
2009-08-11 17:26:35 +08:00
parent e277877541
commit 5dfeb0e195

View File

@@ -78,6 +78,7 @@ class Preview extends SurfaceView implements SurfaceHolder.Callback {
// Because the CameraDevice object is not a shared resource, it's very // Because the CameraDevice object is not a shared resource, it's very
// important to release it when the activity is paused. // important to release it when the activity is paused.
mCamera.stopPreview(); mCamera.stopPreview();
mCamera.release();
mCamera = null; mCamera = null;
} }