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
|
||||
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
|
||||
|
@ -41,23 +41,14 @@ namespace sf
|
||||
Image::Image() :
|
||||
m_size(0, 0)
|
||||
{
|
||||
#ifdef SFML_SYSTEM_ANDROID
|
||||
|
||||
m_stream = NULL;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
|
||||
if (m_stream)
|
||||
delete (priv::ResourceStream*)m_stream;
|
||||
|
||||
m_stream = new priv::ResourceStream(filename);
|
||||
return loadFromStream(*(priv::ResourceStream*)m_stream);
|
||||
priv::ResourceStream stream(filename);
|
||||
return loadFromStream(stream);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user