HighTechTalks DotNet Forums  

SAFFEARRAY And Compac Framework leak

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss SAFFEARRAY And Compac Framework leak in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?VGhlU2ViYXN0ZXI=?=
 
Posts: n/a

Default SAFFEARRAY And Compac Framework leak - 07-31-2007 , 09:36 AM






I am trying to consume those 2 safe array into a
c# compac framework application without leaking.

This is the server side methode I am calling:
interface IArrayDataAccess : IDispatch{
[id(1), helpstring("method Get1")] HRESULT Get1([out] SAFEARRAY(LONG)*
_data, [out] SAFEARRAY(CHAR)* _state);
};

And this is the implementation:
STDMETHODIMP CArrayDataAccess::Get1(SAFEARRAY** _data, SAFEARRAY** _state)
{
SAFEARRAYBOUND ArrayBoundaries;
ArrayBoundaries.lLbound = 0;
ArrayBoundaries.cElements = 1000 * 1000 * 1000;

*_data = ::SafeArrayCreate(VT_I4, 1, &ArrayBoundaries);
*_state = ::SafeArrayCreate(VT_UI1, 1, &ArrayBoundaries);

return S_OK;
}

AND this is the C# CF test Application than consume it:
...
Array arData;
Array arState;

objIArrayDataAccess.Get1(out arData, out arState);
System.Diagnostics.Debug.WriteLine("Get: " + lSeq++);

arData = null;
arState = null;
...

The probleme is that under the compac framework, the call to Get1 methode
leak and there is no leak with the same project under win32. Anyone could
help me??
I use the compac framework 2 with latest update and fix.

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.