Bug 880437 - Do not try to release an already released Camera on shutdown. r=blassey

This commit is contained in:
Gian-Carlo Pascutto 2013-07-08 13:25:15 +02:00
Родитель de78bff8d5
Коммит 8bcd332fb1
1 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -113,8 +113,10 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback {
GeckoAppShell.getGeckoInterface().removeAppStateListener(captureAndroid.mAppStateListener);
captureAndroid.StopCapture();
captureAndroid.camera.release();
captureAndroid.camera = null;
if (captureAndroid.camera != null) {
captureAndroid.camera.release();
captureAndroid.camera = null;
}
captureAndroid.context = 0;
View cameraView = GeckoAppShell.getGeckoInterface().getCameraView();
@ -177,8 +179,10 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback {
@Override
public void onPause() {
StopCapture();
camera.release();
camera = null;
if (camera != null) {
camera.release();
camera = null;
}
}
@Override
public void onResume() {