Commit 9d1cc030 authored by hybrid's avatar hybrid

windows32 class unregister fixes by namtabmai

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3244 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 8813f08a
...@@ -624,8 +624,8 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params) ...@@ -624,8 +624,8 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
SetForegroundWindow(HWnd); SetForegroundWindow(HWnd);
// get the codepage used for keyboard input // get the codepage used for keyboard input
KEYBOARD_INPUT_HKL = GetKeyboardLayout(0); KEYBOARD_INPUT_HKL = GetKeyboardLayout(0);
KEYBOARD_INPUT_CODEPAGE = LocaleIdToCodepage( LOWORD(KEYBOARD_INPUT_HKL) ); KEYBOARD_INPUT_CODEPAGE = LocaleIdToCodepage( LOWORD(KEYBOARD_INPUT_HKL) );
} }
...@@ -903,8 +903,13 @@ void CIrrDeviceWin32::closeDevice() ...@@ -903,8 +903,13 @@ void CIrrDeviceWin32::closeDevice()
PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE); PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE);
PostQuitMessage(0); PostQuitMessage(0);
PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE); PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE);
if (ExternalWindow) if (!ExternalWindow)
{
DestroyWindow(HWnd); DestroyWindow(HWnd);
const fschar_t* ClassName = __TEXT("CIrrDeviceWin32");
HINSTANCE hInstance = GetModuleHandle(0);
UnregisterClass(ClassName, hInstance);
}
Close=true; Close=true;
} }
......
...@@ -710,7 +710,13 @@ void CIrrDeviceWinCE::closeDevice() ...@@ -710,7 +710,13 @@ void CIrrDeviceWinCE::closeDevice()
PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE); PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE);
PostQuitMessage(0); PostQuitMessage(0);
PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE); PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE);
DestroyWindow(HWnd); if (!ExternalWindow)
{
DestroyWindow(HWnd);
const fschar_t* ClassName = __TEXT("CIrrDeviceWin32");
HINSTANCE hInstance = GetModuleHandle(0);
UnregisterClass(ClassName, hInstance);
}
Close=true; Close=true;
} }
......
...@@ -127,6 +127,7 @@ bool COpenGLDriver::initDriver(irr::SIrrlichtCreationParameters params, CIrrDevi ...@@ -127,6 +127,7 @@ bool COpenGLDriver::initDriver(irr::SIrrlichtCreationParameters params, CIrrDevi
if (!temporary_wnd) if (!temporary_wnd)
{ {
os::Printer::log("Cannot create a temporary window.", ELL_ERROR); os::Printer::log("Cannot create a temporary window.", ELL_ERROR);
UnregisterClass(ClassName, lhInstance);
return false; return false;
} }
...@@ -197,6 +198,7 @@ bool COpenGLDriver::initDriver(irr::SIrrlichtCreationParameters params, CIrrDevi ...@@ -197,6 +198,7 @@ bool COpenGLDriver::initDriver(irr::SIrrlichtCreationParameters params, CIrrDevi
os::Printer::log("Cannot create a GL device context", "No suitable format for temporary window.", ELL_ERROR); os::Printer::log("Cannot create a GL device context", "No suitable format for temporary window.", ELL_ERROR);
ReleaseDC(temporary_wnd, HDc); ReleaseDC(temporary_wnd, HDc);
DestroyWindow(temporary_wnd); DestroyWindow(temporary_wnd);
UnregisterClass(ClassName, lhInstance);
return false; return false;
} }
...@@ -213,6 +215,7 @@ bool COpenGLDriver::initDriver(irr::SIrrlichtCreationParameters params, CIrrDevi ...@@ -213,6 +215,7 @@ bool COpenGLDriver::initDriver(irr::SIrrlichtCreationParameters params, CIrrDevi
os::Printer::log("Cannot create a temporary GL rendering context.", ELL_ERROR); os::Printer::log("Cannot create a temporary GL rendering context.", ELL_ERROR);
ReleaseDC(temporary_wnd, HDc); ReleaseDC(temporary_wnd, HDc);
DestroyWindow(temporary_wnd); DestroyWindow(temporary_wnd);
UnregisterClass(ClassName, lhInstance);
return false; return false;
} }
...@@ -228,6 +231,7 @@ bool COpenGLDriver::initDriver(irr::SIrrlichtCreationParameters params, CIrrDevi ...@@ -228,6 +231,7 @@ bool COpenGLDriver::initDriver(irr::SIrrlichtCreationParameters params, CIrrDevi
wglDeleteContext(hrc); wglDeleteContext(hrc);
ReleaseDC(temporary_wnd, HDc); ReleaseDC(temporary_wnd, HDc);
DestroyWindow(temporary_wnd); DestroyWindow(temporary_wnd);
UnregisterClass(ClassName, lhInstance);
return false; return false;
} }
...@@ -318,6 +322,7 @@ bool COpenGLDriver::initDriver(irr::SIrrlichtCreationParameters params, CIrrDevi ...@@ -318,6 +322,7 @@ bool COpenGLDriver::initDriver(irr::SIrrlichtCreationParameters params, CIrrDevi
wglDeleteContext(hrc); wglDeleteContext(hrc);
ReleaseDC(temporary_wnd, HDc); ReleaseDC(temporary_wnd, HDc);
DestroyWindow(temporary_wnd); DestroyWindow(temporary_wnd);
UnregisterClass(ClassName, lhInstance);
// get hdc // get hdc
HDc=GetDC(Window); HDc=GetDC(Window);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment