Commit 2ed02b0b authored by nadro's avatar nadro

- Fix for the previous commit.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5266 dfc29bdd-3216-0410-991c-e03cc46cb475
parent f1ee66d8
...@@ -38,8 +38,12 @@ CD3D9Texture::CD3D9Texture(const io::path& name, const core::array<IImage*>& ima ...@@ -38,8 +38,12 @@ CD3D9Texture::CD3D9Texture(const io::path& name, const core::array<IImage*>& ima
core::array<IImage*> tmpImage = image; core::array<IImage*> tmpImage = image;
bool releaseImageData = false;
if (OriginalSize != Size || OriginalColorFormat != ColorFormat) if (OriginalSize != Size || OriginalColorFormat != ColorFormat)
{ {
releaseImageData = true;
for (u32 i = 0; i < image.size(); ++i) for (u32 i = 0; i < image.size(); ++i)
{ {
tmpImage[i] = Driver->createImage(ColorFormat, Size); tmpImage[i] = Driver->createImage(ColorFormat, Size);
...@@ -103,9 +107,10 @@ CD3D9Texture::CD3D9Texture(const io::path& name, const core::array<IImage*>& ima ...@@ -103,9 +107,10 @@ CD3D9Texture::CD3D9Texture(const io::path& name, const core::array<IImage*>& ima
os::Printer::log("Could not create DIRECT3D9 Texture.", ELL_WARNING); os::Printer::log("Could not create DIRECT3D9 Texture.", ELL_WARNING);
} }
for (u32 i = 0; i < tmpImage.size(); ++i) if (releaseImageData)
{ {
tmpImage[i]->drop(); for (u32 i = 0; i < tmpImage.size(); ++i)
tmpImage[i]->drop();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment