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

Commit a254b1f

Browse files
author
Ehsan Akhgari
committed
Bug 865550 - Unlink AudioBufferSourceNode members before AudioNode; r=mccr8
1 parent eabaf3e commit a254b1f

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

content/media/webaudio/AudioBufferSourceNode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
namespace mozilla {
1818
namespace dom {
1919

20-
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(AudioBufferSourceNode, AudioNode)
20+
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AudioBufferSourceNode)
2121
NS_IMPL_CYCLE_COLLECTION_UNLINK(mBuffer)
2222
NS_IMPL_CYCLE_COLLECTION_UNLINK(mPlaybackRate)
2323
if (tmp->Context()) {
2424
tmp->Context()->UnregisterAudioBufferSourceNode(tmp);
2525
}
26-
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
26+
NS_IMPL_CYCLE_COLLECTION_UNLINK_END_INHERITED(AudioNode)
2727

2828
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(AudioBufferSourceNode, AudioNode)
2929
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBuffer)

xpcom/glue/nsCycleCollectionParticipant.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,12 @@ T* DowncastCCParticipant(void *p)
381381

382382
///////////////////////////////////////////////////////////////////////////////
383383
// Helpers for implementing nsCycleCollectionParticipant::Unlink
384+
//
385+
// You need to use NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED if you want
386+
// the base class Unlink version to be called before your own implementation.
387+
// You can use NS_IMPL_CYCLE_COLLECTION_UNLINK_END_INHERITED if you want the
388+
// base class Unlink to get called after your own implementation. You should
389+
// never use them together.
384390
///////////////////////////////////////////////////////////////////////////////
385391

386392
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class) \
@@ -402,6 +408,13 @@ T* DowncastCCParticipant(void *p)
402408
return NS_OK; \
403409
}
404410

411+
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_END_INHERITED(_base_class) \
412+
nsISupports *s = static_cast<nsISupports*>(p); \
413+
NS_CYCLE_COLLECTION_CLASSNAME(_base_class)::UnlinkImpl(s); \
414+
(void)tmp; \
415+
return NS_OK; \
416+
}
417+
405418
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_0(_class) \
406419
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class) \
407420
NS_IMPL_CYCLE_COLLECTION_UNLINK_END

0 commit comments

Comments
 (0)