Fixed a memory leak in sf::Window implementation on Windows

Synchronized sfml2 with trunk

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1280 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2009-11-21 21:39:31 +00:00
parent 3fb9888b49
commit a32d30c1be

View File

@ -150,10 +150,12 @@ myIsCursorIn (false)
RegisterWindowClass();
// Compute position and size
int Left = (GetDeviceCaps(GetDC(NULL), HORZRES) - Mode.Width) / 2;
int Top = (GetDeviceCaps(GetDC(NULL), VERTRES) - Mode.Height) / 2;
HDC ScreenDC = GetDC(NULL);
int Left = (GetDeviceCaps(ScreenDC, HORZRES) - Mode.Width) / 2;
int Top = (GetDeviceCaps(ScreenDC, VERTRES) - Mode.Height) / 2;
int Width = myWidth = Mode.Width;
int Height = myHeight = Mode.Height;
ReleaseDC(NULL, ScreenDC);
// Choose the window style according to the Style parameter
DWORD Win32Style = WS_VISIBLE;