LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Matthias on January 06, 2010, 23:03:20

Title: Native resource leek on Windows
Post by: Matthias on January 06, 2010, 23:03:20
After creating and destroying several thousand cursors it fails with "Could not allocate DIB section".

It looks like Java_org_lwjgl_opengl_WindowsDisplay_doDestroyCursor() in src/native/windows/org_lwjgl_input_Cursor.c uses the wrong method to delete the cursor handle. According to http://msdn.microsoft.com/en-us/library/ms648062(VS.85).aspx (http://msdn.microsoft.com/en-us/library/ms648062(VS.85).aspx) DestroyIcon should be used to delete the Icon, but the code uses DestroyCursor.
Title: Re: Native resource leek on Windows
Post by: Matzon on January 07, 2010, 08:24:37
well dont! ;D

will check it out soon
Title: Re: Native resource leek on Windows
Post by: Matzon on January 10, 2010, 22:47:42
fixed in nightly - DestroyCursor should be fine, but we're leaking a DC. Fixed this - please confirm.
Title: Re: Native resource leek on Windows
Post by: Matthias on January 11, 2010, 22:33:53
I let the test run for ~20 min and no crash.

Good work.
Thanks Matzon