fix a gdi leak bug.