optimiz3 / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

Mesh::CreateText Bug! #788

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi!

I'm using the last version of SlimDX in C# language (Direct3D9).

i call the "CreateText" method of mesh class
in an infinite loop and then i immediately call the "Dispose"
method of the created mesh, But when i open the task manager program the memory 
usage of my application increases continuously.

I took a look at mesh.cpp file and i found this:

HDC hdc = CreateCompatibleDC( NULL );
HFONT newFont;
HFONT oldFont;
.
.
.
SelectObject( hdc, oldFont );
DeleteObject( newFont );
DeleteDC( hdc );
.
.
.

Note that the "oldFont" object is not deleted!!!

Original issue reported on code.google.com by Far...@gmail.com on 4 Apr 2011 at 3:48

GoogleCodeExporter commented 8 years ago
The oldFont object is the original font that was stored for the DC before we 
touched it. We didn't create it and it's not our responsibility to destroy it. 
Additionally, task manager is not a useful way to monitor memory leaks, 
especially with .NET code.

We need better indications that there is actually a leak here in order to do 
anything.

Original comment by promit....@gmail.com on 4 Apr 2011 at 3:54

GoogleCodeExporter commented 8 years ago

Original comment by josh.petrie on 6 May 2011 at 2:11