[Android] Fixed memory leak when loading asset files
This commit is contained in:
parent
891cd261b8
commit
634c3dc2a7
9 changed files with 275 additions and 109 deletions
|
@ -305,6 +305,9 @@ private :
|
|||
Info m_info; ///< Information about the font
|
||||
mutable PageTable m_pages; ///< Table containing the glyphs pages by character size
|
||||
mutable std::vector<Uint8> m_pixelBuffer; ///< Pixel buffer holding a glyph's pixels before being written to the texture
|
||||
#ifdef SFML_SYSTEM_ANDROID
|
||||
void* m_stream; ///< Asset file streamer (if loaded from file)
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace sf
|
||||
|
@ -351,19 +354,19 @@ private :
|
|||
/// \code
|
||||
/// // Declare a new font
|
||||
/// sf::Font font;
|
||||
///
|
||||
///
|
||||
/// // Load it from a file
|
||||
/// if (!font.loadFromFile("arial.ttf"))
|
||||
/// {
|
||||
/// // error...
|
||||
/// }
|
||||
///
|
||||
///
|
||||
/// // Create a text which uses our font
|
||||
/// sf::Text text1;
|
||||
/// text1.setFont(font);
|
||||
/// text1.setCharacterSize(30);
|
||||
/// text1.setStyle(sf::Text::Regular);
|
||||
///
|
||||
///
|
||||
/// // Create another text using the same font, but with different parameters
|
||||
/// sf::Text text2;
|
||||
/// text2.setFont(font);
|
||||
|
|
|
@ -55,6 +55,12 @@ public :
|
|||
////////////////////////////////////////////////////////////
|
||||
Image();
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destructor
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
~Image();
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Create the image and fill it with a unique color
|
||||
///
|
||||
|
@ -259,6 +265,9 @@ 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue