Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
microsoft.public.dotnet.framework.interop
memory leak .. passing output string arg from C# to Managed C++
tintincat1977
2/2/2007 8:28:00 PM
I have the following sample code that is slowly leaking memory. Any
ideas?
TIA!
Tian
---
managed c++ code:
----------------
void foo::bar (String __gc * __gc *out_str)
{
//do something
//assign some "hard-coded" value to out_str
*out_str = Marshal::PtrToStringAnsi(static_cast<IntPtr>("test
string"));
}
----------------------------------------------
foo::bar() Called from C#
--------------------------
string s = null;
for(;;) {
afoo.bar(ref s);
}
----------------------------------
1 Answer
tintincat1977
2/2/2007 9:37:00 PM
0
Oops, I just now noticed that if I let it run long enough (like 20
mins or so), the memory usage stabilizes.
So, pls ignore my first post.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
memory leak .. passing output string arg from C# to Managed C++
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password