WinMain: Use the correct function to close the event handle
authorFabian Keil <fk@fabiankeil.de>
Wed, 12 Aug 2015 10:39:16 +0000 (10:39 +0000)
committerFabian Keil <fk@fabiankeil.de>
Wed, 12 Aug 2015 10:39:16 +0000 (10:39 +0000)
commitcf15fe9e050f5afc72c3079f43466750f1aa67fb
tree453d0a691a649d728a950f8b9d114d86fd79b82a
parent89211e8fdf1de5bb1358eed372cf219ce3562f36
WinMain: Use the correct function to close the event handle

According to Microsoft's documentation DeleteObject() is
used to delete a "logical pen, brush, font, bitmap, region,
or palette" while CloseHandle() is supposed to be used
for the handle returned by CreateEvent():
https://msdn.microsoft.com/en-us/library/windows/desktop/dd183539%28v=vs.85%29.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682396%28v=vs.85%29.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724211%28v=vs.85%29.aspx

It's conceivable that this commit fixes a tiny memory leak,
but then again maybe not as DeleteObject() is apparently full
of magic:
http://blogs.msdn.com/b/oldnewthing/archive/2013/03/06/10399678.aspx

Reported by Jarry Xu in #891.
win32.c