mirror of
https://github.com/SFML/SFML.git
synced 2024-12-01 15:51:04 +08:00
Android: No longer keep an active input stream longer than needed.
This commit is contained in:
parent
3a96024f6b
commit
1e800d9551
@ -265,9 +265,6 @@ private:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Vector2u m_size; ///< Image size
|
Vector2u m_size; ///< Image size
|
||||||
std::vector<Uint8> m_pixels; ///< Pixels of the image
|
std::vector<Uint8> m_pixels; ///< Pixels of the image
|
||||||
#ifdef SFML_SYSTEM_ANDROID
|
|
||||||
void* m_stream; ///< Asset file streamer (if loaded from file)
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sf
|
} // namespace sf
|
||||||
|
@ -41,23 +41,14 @@ namespace sf
|
|||||||
Image::Image() :
|
Image::Image() :
|
||||||
m_size(0, 0)
|
m_size(0, 0)
|
||||||
{
|
{
|
||||||
#ifdef SFML_SYSTEM_ANDROID
|
|
||||||
|
|
||||||
m_stream = NULL;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Image::~Image()
|
Image::~Image()
|
||||||
{
|
{
|
||||||
#ifdef SFML_SYSTEM_ANDROID
|
|
||||||
|
|
||||||
if (m_stream)
|
|
||||||
delete (priv::ResourceStream*)m_stream;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -135,11 +126,8 @@ bool Image::loadFromFile(const std::string& filename)
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if (m_stream)
|
priv::ResourceStream stream(filename);
|
||||||
delete (priv::ResourceStream*)m_stream;
|
return loadFromStream(stream);
|
||||||
|
|
||||||
m_stream = new priv::ResourceStream(filename);
|
|
||||||
return loadFromStream(*(priv::ResourceStream*)m_stream);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user