List Info

Thread: CN: Fix some memory leaks.




CN: Fix some memory leaks.
user name
2006-09-01 17:27:16
Now checked into HEAD.
--greg.


Eric Hyche wrote:
> These splay changes look good. 
> 
>> -----Original Message-----
>> From: clientapps-dev-bounceshelixcommunity.org 
>> [mailto:clientapps-dev-bounceshelixcommunity.org] On Behalf 
>> Of Greg Wright
>> Sent: Thursday, August 31, 2006 10:21 PM
>> To: clientapps-dev
>> Subject: [Clientapps-dev] CR: Fix some memory
leaks.
>>
>> m_pSite is used for image capture, it was being set
and AddRef'ed
>> at each call to SitesNeeded() but was not being
released. Since
>> image capture only works on single site's right
now, we only need
>> one of them. The change below assumes that we just
capture the
>> first site created and non others. This lets us
capture from the
>> top level site but not leak in the cases that we
have more then
>> 1 site.
>>
>> Also, we were not calling Close() on the media
platform. I believe
>> it was being called from the dtor after being
released, but we
>> want devs to call Close() and not rely on the fact
that Close()
>> is often called from dtors.
>>
>> HEAD only.
>>
>> --greg.
>>
>>
>> Index: exsitsup.cpp
>>
============================================================
=======
>> RCS file:
/cvsroot/clientapps/simpleplayer/exsitsup.cpp,v
>> retrieving revision 1.4
>> diff -u -w -r1.4 exsitsup.cpp
>> --- exsitsup.cpp	27 Apr 2006 22:40:10 -0000	1.4
>> +++ exsitsup.cpp	1 Sep 2006 02:19:49 -0000
>>  -202,8 +202,13 
>>       {
>>   	goto exit;
>>       }
>> +
>> +    if( !m_pSite )
>> +    {
>>       m_pSite = pSite;
>>       m_pSite->AddRef();
>> +    }
>> +
>>
>>       hres = 
>>
pSiteWindowed->QueryInterface(IID_IHXValues,(void**)&
pSiteProps);
>>       if (HXR_OK != hres)
>> Index: main.cpp
>>
============================================================
=======
>> RCS file:
/cvsroot/clientapps/simpleplayer/main.cpp,v
>> retrieving revision 1.69
>> diff -u -w -r1.69 main.cpp
>> --- main.cpp	24 Aug 2006 23:03:02 -0000	1.69
>> +++ main.cpp	1 Sep 2006 02:19:49 -0000
>>  -2258,6 +2258,7 
>>               // persistent information(i.e.
preferences) 
>> maintained by the
>>               // platform
>>               //
GetGlobal()->pMediaPlatform->Reset(NULL);
>> +           
GetGlobal()->pMediaPlatform->Close();
>>              
HX_RELEASE(GetGlobal()->pMediaPlatform);
>>           }
>>
>>
>> _______________________________________________
>> Clientapps-dev mailing list
>> Clientapps-devhelixcommunity.org
>> http://lists.helixcommunity.org/mailman/listinfo/
clientapps-dev
>>
> 
> 

_______________________________________________
Clientapps-dev mailing list
Clientapps-devhelixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/
clientapps-dev
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )