diff --git a/dom/camera/DOMCameraControl.cpp b/dom/camera/DOMCameraControl.cpp index 9bae8d84be78..beb25dbab897 100644 --- a/dom/camera/DOMCameraControl.cpp +++ b/dom/camera/DOMCameraControl.cpp @@ -757,11 +757,7 @@ nsDOMCameraControl::OnCreatedFileDescriptor(bool aSucceeded) return; } } - // An error occured. We need to manually close the file descriptor since - // the FileDescriptor destructor doesn't close file handles which originate - // from other processes. - int fd = mDSFileDescriptor->mFileDescriptor.PlatformHandle(); - ScopedClose autoClose(fd); + OnError(CameraControlListener::kInStartRecording, NS_LITERAL_STRING("FAILURE")); } diff --git a/dom/camera/GonkCameraControl.cpp b/dom/camera/GonkCameraControl.cpp index 5efde7ec6e33..61c738d55d8c 100644 --- a/dom/camera/GonkCameraControl.cpp +++ b/dom/camera/GonkCameraControl.cpp @@ -856,11 +856,7 @@ nsGonkCameraControl::StartRecordingImpl(DeviceStorageFileDescriptor* aFileDescri } nsresult rv; - // SetupRecording creates a dup of the file descriptor, and since it - // was created in the parent, the FileDescriptor destructor won't close - // it, so we go ahead and close it once we leave this function. int fd = aFileDescriptor->mFileDescriptor.PlatformHandle(); - ScopedClose autoClose(fd); if (aOptions) { rv = SetupRecording(fd, aOptions->rotation, aOptions->maxFileSizeBytes, aOptions->maxVideoLengthMs);