From d165966bea3f4465624117226584062d17b6427d Mon Sep 17 00:00:00 2001 From: elsid Date: Wed, 20 Jul 2022 21:53:21 +0200 Subject: [PATCH] Make OSGTexture final To show that there are no more inheritance levels and also help compiler to better optimize virtual function calls. There is no need to access virtual table when compiler calls a virtual function of a final type. --- components/myguiplatform/myguitexture.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/myguiplatform/myguitexture.hpp b/components/myguiplatform/myguitexture.hpp index 4f7ff8f116..02079798d3 100644 --- a/components/myguiplatform/myguitexture.hpp +++ b/components/myguiplatform/myguitexture.hpp @@ -20,7 +20,8 @@ namespace Resource namespace osgMyGUI { - class OSGTexture : public MyGUI::ITexture { + class OSGTexture final : public MyGUI::ITexture + { std::string mName; Resource::ImageManager* mImageManager; @@ -37,7 +38,7 @@ namespace osgMyGUI public: OSGTexture(const std::string &name, Resource::ImageManager* imageManager); OSGTexture(osg::Texture2D* texture, osg::StateSet* injectState = nullptr); - virtual ~OSGTexture(); + ~OSGTexture() override; osg::StateSet* getInjectState() { return mInjectState; }