Closed Bug 821439 Opened 13 years ago Closed 13 years ago

Signaling code is leaking instances of RemoteSourceStreamInfo

Categories

(Core :: WebRTC: Signaling, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 820102

People

(Reporter: ehugg, Unassigned)

References

Details

(Keywords: memory-leak)

Attachments

(1 file)

Either one too many addrefs or one too few releases of RemoteSourceStreamInfo are causing them to stay around.
Blocks: 812648
Keywords: mlk
Comment on attachment 691996 [details] [diff] [review] Stop leaking RemoteSourceStreamInfo Is this the way you considered removing the AddRefs?
Attachment #691996 - Flags: review?(ekr)
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)
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
Attachment #691996 - Flags: review?(ekr)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: