Closed
Bug 821439
Opened 13 years ago
Closed 13 years ago
Signaling code is leaking instances of RemoteSourceStreamInfo
Categories
(Core :: WebRTC: Signaling, defect)
Core
WebRTC: Signaling
Tracking
()
RESOLVED
DUPLICATE
of bug 820102
People
(Reporter: ehugg, Unassigned)
References
Details
(Keywords: memory-leak)
Attachments
(1 file)
5.37 KB,
patch
|
Details | Diff | Splinter Review |
Either one too many addrefs or one too few releases of RemoteSourceStreamInfo are causing them to stay around.
Updated•13 years ago
|
Reporter | ||
Comment 1•13 years ago
|
||
Reporter | ||
Comment 2•13 years ago
|
||
Comment on attachment 691996 [details] [diff] [review]
Stop leaking RemoteSourceStreamInfo
Is this the way you considered removing the AddRefs?
Attachment #691996 -
Flags: review?(ekr)
Comment 3•13 years ago
|
||
r- but trivially resolvable
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
> nsresult
> PeerConnectionImpl::MakeRemoteSource(nsDOMMediaStream* aStream, > nsRefPtr<RemoteSourceStreamInfo>* aInfo)
I'd prefer a signature like:
already_AddRefed<RemoteSourceStreamInfo>
PeerConnectionImpl::MakeRemoteSource(nsDOMMediaStream* aStream)
{
MOZ_ASSERT(aStream);
nsRefPtr<RemoteSourceStreamInfo> info = new RemoteSourceStreamInfo(aStream);
return info.forget();
}
Avoids extra refs, avoids the useless nsresult that's ignored, avoids passing a pointer to an nsRefPtr, etc.
Alternatively, use nsRefPtr<>& instead of * - this is the common usage for that sort of thing
nsresult
PeerConnectionImpl::CreateRemoteSourceStreamInfo(uint32_t aHint, nsRefPtr<RemoteSourceStreamInfo>* aInfo)
And somewhat similarly:
PeerConnectionImpl::CreateRemoteSourceStreamInfo(uint32_t aHint, nsRefPtr<RemoteSourceStreamInfo>& aInfo)
Reporter | ||
Comment 4•13 years ago
|
||
This will will be fixed as part of the patch to Bug 820102. Setting this as a dupe.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Updated•12 years ago
|
Attachment #691996 -
Flags: review?(ekr)
You need to log in
before you can comment on or make changes to this bug.
Description
•