Avoid using owning raw pointer

crashfix_debugdraw
elsid 2 years ago
parent 23e765954d
commit 838d75a2e2
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -1734,7 +1734,7 @@ namespace MWRender
mRootController = addRotateController("bip01"); mRootController = addRotateController("bip01");
} }
RotateController* Animation::addRotateController(const std::string &bone) osg::ref_ptr<RotateController> Animation::addRotateController(const std::string &bone)
{ {
auto iter = getNodeMap().find(bone); auto iter = getNodeMap().find(bone);
if (iter == getNodeMap().end()) if (iter == getNodeMap().end())
@ -1757,7 +1757,7 @@ namespace MWRender
if (!foundKeyframeCtrl) if (!foundKeyframeCtrl)
return nullptr; return nullptr;
RotateController* controller = new RotateController(mObjectRoot.get()); osg::ref_ptr<RotateController> controller(new RotateController(mObjectRoot.get()));
node->addUpdateCallback(controller); node->addUpdateCallback(controller);
mActiveControllers.emplace_back(node, controller); mActiveControllers.emplace_back(node, controller);
return controller; return controller;

@ -274,7 +274,7 @@ protected:
float mLegsYawRadians; float mLegsYawRadians;
float mBodyPitchRadians; float mBodyPitchRadians;
RotateController* addRotateController(const std::string& bone); osg::ref_ptr<RotateController> addRotateController(const std::string& bone);
bool mHasMagicEffects; bool mHasMagicEffects;

Loading…
Cancel
Save