Skip to content

How to release the textures of a closed document #651

Answered by mikke89
hadi-rahimi asked this question in Q&A
Discussion options

You must be logged in to vote

Hello, and thanks for the kind words!

You're right, we don't release textures automatically until the library is shut down. The idea is that many use cases involve showing and hiding elements with images, or rewriting the RML with images involved. Or even successively opening and closing documents. In such cases, the assumption is that one normally want to keep textures around so that they don't need to be reloaded unnecessarily.

I understand this behavior doesn't fit all use cases, and indeed, calling Rml::ReleaseTextures() is the intended way to release textures in such scenarios. So I would suggest to continue using this in your case. One perhaps unfortunate effect of this is that it r…

Replies: 7 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by hadi-rahimi
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Paril
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@mikke89
Comment options

@hadi-rahimi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants