mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 977372 - Close IPC'd filedescriptor from device descriptor when finished with it. r=mikeh
This commit is contained in:
parent
3b35009dde
commit
9f07169289
@ -11,6 +11,7 @@
|
|||||||
#include "DeviceStorage.h"
|
#include "DeviceStorage.h"
|
||||||
#include "DeviceStorageFileDescriptor.h"
|
#include "DeviceStorageFileDescriptor.h"
|
||||||
#include "mozilla/dom/TabChild.h"
|
#include "mozilla/dom/TabChild.h"
|
||||||
|
#include "mozilla/FileUtils.h"
|
||||||
#include "mozilla/MediaManager.h"
|
#include "mozilla/MediaManager.h"
|
||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
#include "mozilla/unused.h"
|
#include "mozilla/unused.h"
|
||||||
@ -728,7 +729,11 @@ nsDOMCameraControl::OnCreatedFileDescriptor(bool aSucceeded)
|
|||||||
return;
|
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"));
|
OnError(CameraControlListener::kInStartRecording, NS_LITERAL_STRING("FAILURE"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -856,7 +856,11 @@ nsGonkCameraControl::StartRecordingImpl(DeviceStorageFileDescriptor* aFileDescri
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsresult rv;
|
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();
|
int fd = aFileDescriptor->mFileDescriptor.PlatformHandle();
|
||||||
|
ScopedClose autoClose(fd);
|
||||||
if (aOptions) {
|
if (aOptions) {
|
||||||
rv = SetupRecording(fd, aOptions->rotation, aOptions->maxFileSizeBytes,
|
rv = SetupRecording(fd, aOptions->rotation, aOptions->maxFileSizeBytes,
|
||||||
aOptions->maxVideoLengthMs);
|
aOptions->maxVideoLengthMs);
|
||||||
|
Loading…
Reference in New Issue
Block a user