[Live-devel] small leaks
Ross Finlayson
finlayson at live.com
Thu Aug 12 11:37:34 PDT 2004
At 07:10 AM 8/12/04, you wrote:
>I think that I might have idenfied some small leaks.
>Here are the changes I made:
>
>----------------------------------------
>*rtspclient.cpp
>
>RTSPClient::~RTSPClient() {
> reset();
> delete[] fUserAgentHeaderStr;
> if (fLastSessionId)
> delete[] fLastSessionId;
>}
It turns out that "fLastSessionId" was already deleted (and set to NULL) in
the call to "reset()" - so there's no need to delete it again :-)
>-------------------------------------------
>*rtcp.cpp, reapOldMembers(unsigned threshold)
>
>...
>
> if (foundOldMember) {
>#ifdef DEBUG
> fprintf(stderr, "reap: removing SSRC 0x%x\n", oldSSRC);
>#endif
> remove(oldSSRC);
> }
> delete iter;
> } while (foundOldMember);
>}
>
>---------------------------
>*hashtable.cpp
>
>void* HashTable::RemoveNext() {
> Iterator* iter = Iterator::create(*this);
> char const* key;
> void* removedValue = iter->next(key);
> if (removedValue != 0) Remove(key);
>
> delete iter;
> return removedValue;
>}
Yes, in both cases the addition of "delete iter" removed a small
leak. Thanks for noticing this. I have now installed a new version
(2004.08.120 of the code with those fixes.
Ross Finlayson
LIVE.COM
<http://www.live.com/>
More information about the live-devel
mailing list