Native resource leek on Windows

Started by Matthias, January 06, 2010, 23:03:20

Previous topic - Next topic

Matthias

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 DestroyIcon should be used to delete the Icon, but the code uses DestroyCursor.

Matzon


Matzon

fixed in nightly - DestroyCursor should be fine, but we're leaking a DC. Fixed this - please confirm.

Matthias

I let the test run for ~20 min and no crash.

Good work.
Thanks Matzon