Fix several leaks

pull/83/head
scrawl 11 years ago
parent f99eda1a54
commit 6f7fbc867f

@ -35,7 +35,7 @@ namespace MWGui
, mTrading(false) , mTrading(false)
, mLastXSize(0) , mLastXSize(0)
, mLastYSize(0) , mLastYSize(0)
, mPreview(MWBase::Environment::get().getWorld ()->getPlayerPtr()) , mPreview(new MWRender::InventoryPreview(MWBase::Environment::get().getWorld ()->getPlayerPtr()))
, mPreviewDirty(true) , mPreviewDirty(true)
, mDragAndDrop(dragAndDrop) , mDragAndDrop(dragAndDrop)
, mSelectedItem(-1) , mSelectedItem(-1)
@ -91,8 +91,8 @@ namespace MWGui
mTradeModel = new TradeItemModel(new InventoryItemModel(mPtr), MWWorld::Ptr()); mTradeModel = new TradeItemModel(new InventoryItemModel(mPtr), MWWorld::Ptr());
mSortModel = new SortFilterItemModel(mTradeModel); mSortModel = new SortFilterItemModel(mTradeModel);
mItemView->setModel(mSortModel); mItemView->setModel(mSortModel);
mPreview = MWRender::InventoryPreview(mPtr); mPreview.reset(new MWRender::InventoryPreview(mPtr));
mPreview.setup(); mPreview->setup();
} }
void InventoryWindow::setGuiMode(GuiMode mode) void InventoryWindow::setGuiMode(GuiMode mode)
@ -444,7 +444,7 @@ namespace MWGui
MWWorld::Ptr InventoryWindow::getAvatarSelectedItem(int x, int y) MWWorld::Ptr InventoryWindow::getAvatarSelectedItem(int x, int y)
{ {
int slot = mPreview.getSlotSelected (x, y); int slot = mPreview->getSlotSelected (x, y);
if (slot == -1) if (slot == -1)
return MWWorld::Ptr(); return MWWorld::Ptr();
@ -493,7 +493,7 @@ namespace MWGui
mPreviewDirty = false; mPreviewDirty = false;
MyGUI::IntSize size = mAvatarImage->getSize(); MyGUI::IntSize size = mAvatarImage->getSize();
mPreview.update (size.width, size.height); mPreview->update (size.width, size.height);
mAvatarImage->setImageTexture("CharacterPreview"); mAvatarImage->setImageTexture("CharacterPreview");
mAvatarImage->setImageCoord(MyGUI::IntCoord(0, 0, std::min(512, size.width), std::min(1024, size.height))); mAvatarImage->setImageCoord(MyGUI::IntCoord(0, 0, std::min(512, size.width), std::min(1024, size.height)));

@ -34,7 +34,7 @@ namespace MWGui
MWWorld::Ptr getAvatarSelectedItem(int x, int y); MWWorld::Ptr getAvatarSelectedItem(int x, int y);
void rebuildAvatar() { void rebuildAvatar() {
mPreview.rebuild(); mPreview->rebuild();
} }
TradeItemModel* getTradeModel(); TradeItemModel* getTradeModel();
@ -81,7 +81,7 @@ namespace MWGui
int mLastXSize; int mLastXSize;
int mLastYSize; int mLastYSize;
MWRender::InventoryPreview mPreview; std::auto_ptr<MWRender::InventoryPreview> mPreview;
bool mTrading; bool mTrading;

@ -34,6 +34,10 @@ namespace MWRender
virtual void rebuild(); virtual void rebuild();
private:
CharacterPreview(const CharacterPreview&);
CharacterPreview& operator=(const CharacterPreview&);
protected: protected:
virtual bool renderHeadOnly() { return false; } virtual bool renderHeadOnly() { return false; }

@ -28,7 +28,9 @@ RippleSimulation::RippleSimulation(Ogre::SceneManager* mainSceneManager)
mRippleAreaLength(1000), mRippleAreaLength(1000),
mImpulseSize(20), mImpulseSize(20),
mTexelOffset(0,0), mTexelOffset(0,0),
mFirstUpdate(true) mFirstUpdate(true),
mRectangle(NULL),
mImpulse(NULL)
{ {
Ogre::AxisAlignedBox aabInf; Ogre::AxisAlignedBox aabInf;
aabInf.setInfinite(); aabInf.setInfinite();
@ -105,6 +107,7 @@ RippleSimulation::RippleSimulation(Ogre::SceneManager* mainSceneManager)
RippleSimulation::~RippleSimulation() RippleSimulation::~RippleSimulation()
{ {
delete mRectangle; delete mRectangle;
delete mImpulse;
Ogre::Root::getSingleton().destroySceneManager(mSceneMgr); Ogre::Root::getSingleton().destroySceneManager(mSceneMgr);
} }

@ -62,6 +62,7 @@ namespace OgreInit
OgreInit::~OgreInit() OgreInit::~OgreInit()
{ {
delete mRoot; delete mRoot;
delete Ogre::LogManager::getSingletonPtr();
std::vector<Ogre::ParticleEmitterFactory*>::iterator ei; std::vector<Ogre::ParticleEmitterFactory*>::iterator ei;
for(ei = mEmitterFactories.begin();ei != mEmitterFactories.end();++ei) for(ei = mEmitterFactories.begin();ei != mEmitterFactories.end();++ei)

@ -337,6 +337,8 @@ namespace Terrain
it->mTarget->loadLayers(*it); it->mTarget->loadLayers(*it);
} }
delete data;
mRootNode->loadMaterials(); mRootNode->loadMaterials();
mLayerLoadPending = false; mLayerLoadPending = false;

@ -49,22 +49,6 @@
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/> <BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin> </Skin>
<Skin name="DaedricText" size="16 16">
<Property key="FontName" value="daedric36"/>
<Property key="FontHeight" value="36"/>
<Property key="TextAlign" value="Default"/>
<Property key="TextColour" value="1 1 1"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
<Skin name="DaedricText_orig" size="16 16">
<Property key="FontName" value="daedric_orig36"/>
<Property key="FontHeight" value="36"/>
<Property key="TextAlign" value="Default"/>
<Property key="TextColour" value="1 1 1"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
<Skin name="MW_StatNameC" size="200 18"> <Skin name="MW_StatNameC" size="200 18">
<Child type="TextBoxC" skin="SandText" offset="0 0 200 18" align="Left HStretch" name="StatName"/> <Child type="TextBoxC" skin="SandText" offset="0 0 200 18" align="Left HStretch" name="StatName"/>
</Skin> </Skin>

Loading…
Cancel
Save