void PeerConnection::addStream(PassRefPtr<MediaStream> prpStream, ExceptionCode& ec) { ...... // The MediaStream object is guaranteed to exist since StrictTypeChecking is set in the idl. RefPtr<MediaStream> stream = prpStream; if (m_localStreams->contains(stream.get())) return; m_localStreams->append(stream); MediaStreamDescriptor* streamDescriptor = stream->descriptor(); ....... } if prpStream is a NULL media stream, then stream->descriptor() may cause memory leak
I'm not sure what you mean by memory leak here. The comment about StrictTypeChecking implies that null media streams are handled by the JS binding so that this method will never be called with a null MediaStream.
(In reply to comment #1) > I'm not sure what you mean by memory leak here. The comment about StrictTypeChecking implies that null media streams are handled by the JS binding so that this method will never be called with a null MediaStream. You are right, I can see the JS binding code deal with addStream arguments, but it's weird in my platform, if I try to new a peerconnection object, then add a null media stream, it doesn't throw any exception. I try to trace the code, and always get a <stream = 0>, then the renderer crashes.
Created attachment 124305 [details] Patch
Comment on attachment 124305 [details] Patch Clearing flags on attachment: 124305 Committed r106275: <http://trac.webkit.org/changeset/106275>
All reviewed patches have been landed. Closing bug.