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: 4
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: 4593
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 970
Contact:

Re: D3D11WindowHwnd::destroy destroys an external Window

Post by dark_sylinc »

Done.

Thanks!

Post Reply