From a561416195f889bebabf79b7da14d0093e5d12c2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 25 Sep 2016 15:46:50 +0200 Subject: [PATCH] release the camera after strobe only if there wont be a perm torch after --- .../java/com/simplemobiletools/flashlight/MyCameraImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/flashlight/MyCameraImpl.java b/app/src/main/java/com/simplemobiletools/flashlight/MyCameraImpl.java index cd18f64..276798a 100644 --- a/app/src/main/java/com/simplemobiletools/flashlight/MyCameraImpl.java +++ b/app/src/main/java/com/simplemobiletools/flashlight/MyCameraImpl.java @@ -221,8 +221,10 @@ public class MyCameraImpl { if (mCamera != null) { mCamera.setParameters(torchOff); - mCamera.release(); - mCamera = null; + if (!mShouldEnableFlashlight) { + mCamera.release(); + mCamera = null; + } } mIsStroboscopeRunning = false; mShouldStroboscopeStop = false;