forked from mirror/openmw-tes3mp
Leak fix
This commit is contained in:
parent
b840c68f0c
commit
2e9805fa0e
2 changed files with 6 additions and 6 deletions
|
@ -157,11 +157,10 @@ namespace MWRender
|
||||||
|
|
||||||
void CharacterPreview::rebuild()
|
void CharacterPreview::rebuild()
|
||||||
{
|
{
|
||||||
delete mAnimation;
|
mAnimation.reset(NULL);
|
||||||
mAnimation = NULL;
|
|
||||||
|
|
||||||
mAnimation = new NpcAnimation(mCharacter, mNode, mResourceSystem, true, true,
|
mAnimation.reset(new NpcAnimation(mCharacter, mNode, mResourceSystem, true, true,
|
||||||
(renderHeadOnly() ? NpcAnimation::VM_HeadOnly : NpcAnimation::VM_Normal));
|
(renderHeadOnly() ? NpcAnimation::VM_HeadOnly : NpcAnimation::VM_Normal)));
|
||||||
|
|
||||||
onSetup();
|
onSetup();
|
||||||
|
|
||||||
|
@ -194,7 +193,7 @@ namespace MWRender
|
||||||
|
|
||||||
void InventoryPreview::update()
|
void InventoryPreview::update()
|
||||||
{
|
{
|
||||||
if (!mAnimation)
|
if (!mAnimation.get())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mAnimation->showWeapons(true);
|
mAnimation->showWeapons(true);
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define MWRENDER_CHARACTERPREVIEW_H
|
#define MWRENDER_CHARACTERPREVIEW_H
|
||||||
|
|
||||||
#include <osg/ref_ptr>
|
#include <osg/ref_ptr>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include <components/esm/loadnpc.hpp>
|
#include <components/esm/loadnpc.hpp>
|
||||||
|
|
||||||
|
@ -61,7 +62,7 @@ namespace MWRender
|
||||||
|
|
||||||
MWWorld::Ptr mCharacter;
|
MWWorld::Ptr mCharacter;
|
||||||
|
|
||||||
MWRender::NpcAnimation* mAnimation;
|
std::auto_ptr<MWRender::NpcAnimation> mAnimation;
|
||||||
osg::ref_ptr<osg::PositionAttitudeTransform> mNode;
|
osg::ref_ptr<osg::PositionAttitudeTransform> mNode;
|
||||||
std::string mCurrentAnimGroup;
|
std::string mCurrentAnimGroup;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue