mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 02:47:31 +09:00
Bug 1426129 - Hold CamerasChild via promoting "this" to a RefPtr. r=pehrsons, a=RyanVM
This commit is contained in:
parent
e6afe55c10
commit
8e5fec311a
2 changed files with 23 additions and 3 deletions
|
|
@ -89,6 +89,14 @@ public:
|
|||
return gTheInstance.get()->mFakeDeviceChangeEventThread;
|
||||
}
|
||||
|
||||
static bool InShutdown() {
|
||||
return gTheInstance.get()->mInShutdown;
|
||||
}
|
||||
|
||||
static void StartShutdown() {
|
||||
gTheInstance.get()->mInShutdown = true;
|
||||
}
|
||||
|
||||
private:
|
||||
static Singleton<CamerasSingleton> gTheInstance;
|
||||
|
||||
|
|
@ -106,6 +114,7 @@ private:
|
|||
CamerasChild* mCameras;
|
||||
nsCOMPtr<nsIThread> mCamerasChildThread;
|
||||
nsCOMPtr<nsIThread> mFakeDeviceChangeEventThread;
|
||||
Atomic<bool> mInShutdown;
|
||||
};
|
||||
|
||||
// Get a pointer to a CamerasChild object we can use to do IPC with.
|
||||
|
|
@ -145,7 +154,7 @@ class CamerasChild final : public PCamerasChild
|
|||
public:
|
||||
// We are owned by the PBackground thread only. CamerasSingleton
|
||||
// takes a non-owning reference.
|
||||
NS_INLINE_DECL_REFCOUNTING(CamerasChild)
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CamerasChild)
|
||||
|
||||
// IPC messages recevied, received on the PBackground thread
|
||||
// these are the actual callbacks with data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue