diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 07562a7593..0882dce4ac 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -1734,7 +1734,7 @@ namespace MWRender mRootController = addRotateController("bip01"); } - RotateController* Animation::addRotateController(const std::string &bone) + osg::ref_ptr Animation::addRotateController(const std::string &bone) { auto iter = getNodeMap().find(bone); if (iter == getNodeMap().end()) @@ -1757,7 +1757,7 @@ namespace MWRender if (!foundKeyframeCtrl) return nullptr; - RotateController* controller = new RotateController(mObjectRoot.get()); + osg::ref_ptr controller(new RotateController(mObjectRoot.get())); node->addUpdateCallback(controller); mActiveControllers.emplace_back(node, controller); return controller; diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index b3604dcaf1..1120813805 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -274,7 +274,7 @@ protected: float mLegsYawRadians; float mBodyPitchRadians; - RotateController* addRotateController(const std::string& bone); + osg::ref_ptr addRotateController(const std::string& bone); bool mHasMagicEffects;