@@ -602,6 +602,7 @@ void Ogre2GpuRays::Destroy()
602
602
603
603
auto engine = Ogre2RenderEngine::Instance ();
604
604
auto ogreRoot = engine->OgreRoot ();
605
+ auto textureGpuManager = ogreRoot->getRenderSystem ()->getTextureGpuManager ();
605
606
606
607
Ogre::CompositorManager2 *ogreCompMgr = ogreRoot->getCompositorManager2 ();
607
608
@@ -616,17 +617,15 @@ void Ogre2GpuRays::Destroy()
616
617
}
617
618
if (this ->dataPtr ->firstPassTextures [i])
618
619
{
619
- ogreRoot->getRenderSystem ()->getTextureGpuManager ()->destroyTexture (
620
- this ->dataPtr ->firstPassTextures [i]);
620
+ textureGpuManager->destroyTexture (this ->dataPtr ->firstPassTextures [i]);
621
621
this ->dataPtr ->firstPassTextures [i] = nullptr ;
622
622
}
623
623
}
624
624
625
625
// remove 2nd pass texture, material, compositor
626
626
if (this ->dataPtr ->secondPassTexture )
627
627
{
628
- ogreRoot->getRenderSystem ()->getTextureGpuManager ()->destroyTexture (
629
- this ->dataPtr ->secondPassTexture );
628
+ textureGpuManager->destroyTexture (this ->dataPtr ->secondPassTexture );
630
629
this ->dataPtr ->secondPassTexture = nullptr ;
631
630
}
632
631
@@ -636,7 +635,6 @@ void Ogre2GpuRays::Destroy()
636
635
this ->dataPtr ->ogreCompositorWorkspace2nd = nullptr ;
637
636
}
638
637
639
- auto textureGpuManager = ogreRoot->getRenderSystem ()->getTextureGpuManager ();
640
638
if (this ->dataPtr ->cubeUVTexture )
641
639
{
642
640
textureGpuManager->destroyTexture (this ->dataPtr ->cubeUVTexture );
0 commit comments