Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 3aafed5

Browse files
author
Ehsan Akhgari
committed
Backed out changeset 089871cdaf1e (bug 865004) because of crashtest leaks on a CLOSED TREE
1 parent 725002e commit 3aafed5

2 files changed

Lines changed: 8 additions & 17 deletions

File tree

content/media/webaudio/AudioNode.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(AudioNode, nsDOMEventTargetHel
2323
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOutputNodes)
2424
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
2525

26+
NS_IMPL_ADDREF_INHERITED(AudioNode, nsDOMEventTargetHelper)
27+
NS_IMPL_RELEASE_INHERITED(AudioNode, nsDOMEventTargetHelper)
28+
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(AudioNode)
29+
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
30+
2631
AudioNode::AudioNode(AudioContext* aContext)
2732
: mContext(aContext)
2833
{
@@ -33,21 +38,11 @@ AudioNode::AudioNode(AudioContext* aContext)
3338

3439
AudioNode::~AudioNode()
3540
{
41+
DisconnectFromGraph();
3642
MOZ_ASSERT(mInputNodes.IsEmpty());
3743
MOZ_ASSERT(mOutputNodes.IsEmpty());
3844
}
3945

40-
NS_IMETHODIMP_(nsrefcnt)
41-
AudioNode::Release()
42-
{
43-
if (mRefCnt.get() == 1) {
44-
// We are about to be deleted, disconnect the object from the graph before
45-
// the derived type is destroyed.
46-
DisconnectFromGraph();
47-
}
48-
return nsDOMEventTargetHelper::Release();
49-
}
50-
5146
static uint32_t
5247
FindIndexOfNode(const nsTArray<AudioNode::InputNode>& aInputNodes, const AudioNode* aNode)
5348
{

content/media/webaudio/AudioNode.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,9 @@ class SelfReference {
7373
class AudioNode : public nsDOMEventTargetHelper,
7474
public EnableWebAudioCheck
7575
{
76-
protected:
77-
// You can only use refcounting to delete this object
78-
virtual ~AudioNode();
79-
8076
public:
8177
explicit AudioNode(AudioContext* aContext);
78+
virtual ~AudioNode();
8279

8380
// This should be idempotent (safe to call multiple times).
8481
virtual void DestroyMediaStream();
@@ -90,8 +87,7 @@ class AudioNode : public nsDOMEventTargetHelper,
9087
return false;
9188
}
9289

93-
NS_IMETHOD_(nsrefcnt) Release() MOZ_OVERRIDE;
94-
90+
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
9591
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioNode,
9692
nsDOMEventTargetHelper)
9793

0 commit comments

Comments
 (0)