diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java index cad2eeba..cde43096 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java @@ -144,6 +144,8 @@ abstract class CameraController implements CameraPreview.SurfaceCallback { // Don't check, try stop again. LOG.i("Stop immediately. State was:", ss()); mState = STATE_STOPPING; + // Prevent leaking CameraController. + mHandler.getThread().setUncaughtExceptionHandler(null); onStop(); mState = STATE_STOPPED; LOG.i("Stop immediately. Stopped. State is:", ss());