[Live-devel] Memory leak
Ross Finlayson
finlayson at live555.com
Sun Jul 26 07:49:29 PDT 2009
>In teardownMediaSubsession in RTSPClient, the subsession's sessionId
>variable is deleted and reset. However *only if* the teardown
>succeeds. If the teardown fails and the MediaSubsession is
>subsequently closed using the proper method, then the sessionId will
>not be freed. I suggest also delete the pointer in the destructor
>of MediaSubsession in case it has not already being deleted.
No, I don't want to do this, because - in general - the entity that
allocates memory should be the one that deletes it. In this case,
the memory ("sessionId" string) is allocated (and used) only by the
"RTSPClient" - and so the "RTSPClient" should be the only thing that
deletes it.
The actual solution in this case is simply for the "RTSPClient" to
behave as is the RTSP "TEARDOWN" succeeded, regardless of the actual
RTSP response that it gets from the server. I.e., as far as the
client is concerned, the session has ended.
I'll fix this (in "RTSPClient") in the next release of the software.
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list