Fix the crash if stopRecording after release

pull/37/head
tzutalin 8 years ago
parent f129b8e8f9
commit e056f9c998
  1. 3
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/manager/impl/Camera1Manager.java
  2. 3
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/manager/impl/Camera2Manager.java

@ -185,6 +185,9 @@ public class Camera1Manager extends BaseCameraManager<Integer, SurfaceHolder.Cal
backgroundHandler.post(new Runnable() {
@Override
public void run() {
// Tzutalin++ 2017/05. If calling release function, it should not be executed
if (context == null) return;
if (prepareVideoRecorder()) {
videoRecorder.start();
isVideoRecording = true;

@ -267,6 +267,9 @@ public final class Camera2Manager extends BaseCameraManager<String, TextureView.
backgroundHandler.post(new Runnable() {
@Override
public void run() {
// Tzutalin++ 2017/05. If calling release function, it should not be executed
if (context == null) return;
closePreviewSession();
if (prepareVideoRecorder()) {

Loading…
Cancel
Save