-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Win32 Window doesn't unregister class #393
Comments
Hi! The block is protected by a static global variable: if( !mClassRegistered )
{
mClassRegistered = true;
} How are you able to enter that block twice? |
I have to look for it a little more. |
It works as described. When shutting down the 3D rendering part of the application OgreRoot is deleted. That unloads all plugins and therefore the dll. When restarting 3D, the Dll is loaded again and a new set of statics is generated / initalised. But the registration of the windowclass is still active. |
@darksylinc Do you care for me to provide a PR for this? Finishing up on updateing to 2.2 and remembered this issue. |
Sure!!! PRs are more than welcome! |
When creating a window for the DirectX 11 Rendersystem a WindowClass is registered. That window class is not unregistered. In 2.1 that was silently ignored and a window was created anyway, but now (2.2 for me) it fails and throws an exception.
ogre-next\RenderSystems\Direct3D11\src\Windowing\WIN32\OgreD3D11WindowHwnd.cpp
if (!mClassRegistered
{
if (!RegisterClassEx(&wcex))
{
OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR,
"RegisterClassEx failed! Cannot create window",
"D3D11WindowHwnd::create");
}
mClassRegistered = true;
}
Shouldn't this class unregister it`s window class in the destroy function ala?
if( mClassRegistered )
{
UnregisterClass( OGRE_D3D11_WIN_CLASS_NAME, 0 );
mClassRegistered = false;
}
The text was updated successfully, but these errors were encountered: