mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1917652 Part 2: Explicitly define AddRef and Release in VideoBridgeParent. r=aosmond
This change prevents VideoBridgeParent from being incorrectly reported as leaked memory. Something about the logging used by the previous macro confuses the leakchecker. Appropriate deallocation was confirmed by creating manual implementations of AddRef and Release and the various Actor lifecyle methods (not part of this patch). The change to this new approach does the same work as the old macro, minus the conditional logging of the old macro. Differential Revision: https://phabricator.services.mozilla.com/D222715
This commit is contained in:
parent
842297cee4
commit
f470faee03
@ -21,6 +21,9 @@ using namespace mozilla::gfx;
|
||||
using VideoBridgeTable = EnumeratedArray<VideoBridgeSource, VideoBridgeParent*,
|
||||
size_t(VideoBridgeSource::_Count)>;
|
||||
|
||||
NS_IMPL_NONLOGGING_ADDREF_INHERITED(VideoBridgeParent, HostIPCAllocator)
|
||||
NS_IMPL_NONLOGGING_RELEASE_INHERITED(VideoBridgeParent, HostIPCAllocator)
|
||||
|
||||
static StaticDataMutex<VideoBridgeTable> sVideoBridgeFromProcess(
|
||||
"VideoBridges");
|
||||
static Atomic<bool> sVideoBridgeParentShutDown(false);
|
||||
|
@ -20,7 +20,8 @@ class VideoBridgeParent final : public PVideoBridgeParent,
|
||||
public HostIPCAllocator,
|
||||
public mozilla::ipc::IShmemAllocator {
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING_INHERITED(VideoBridgeParent, HostIPCAllocator)
|
||||
NS_IMETHODIMP_(MozExternalRefCountType) AddRef(void) override;
|
||||
NS_IMETHODIMP_(MozExternalRefCountType) Release(void) override;
|
||||
|
||||
static RefPtr<VideoBridgeParent> GetSingleton(
|
||||
const Maybe<VideoBridgeSource>& aSource);
|
||||
|
Loading…
Reference in New Issue
Block a user