D3D11WindowHwnd::destroy destroys an external Window

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
a_programmer
Gnoblar
Posts: 7
Joined: Sun Nov 24, 2019 6:34 pm

D3D11WindowHwnd::destroy destroys an external Window

Post by a_programmer »

As said D3D11WindowHwnd::destroy destroys an external window
https://github.com/OGRECave/ogre-next/b ... owHwnd.cpp

Code: Select all

    void D3D11WindowHwnd::destroy(void)
    {
        D3D11WindowSwapChainBased::destroy();

        if( !mHwnd )
            return;

        WindowEventUtilities::_removeRenderWindow(this);

        DestroyWindow( mHwnd );
        mHwnd = 0;
    }
My suggestion would be:

Code: Select all

    void D3D11WindowHwnd::destroy(void)
    {
        D3D11WindowSwapChainBased::destroy();

        if( mHwnd && !mIsExternal)
        {
               WindowEventUtilities::_removeRenderWindow(this);
               DestroyWindow( mHwnd );
        }
        mHwnd = 0;
    }
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5292
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: D3D11WindowHwnd::destroy destroys an external Window

Post by dark_sylinc »

Done.

Thanks!
Post Reply