-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to free textures without unsafe code? #1107
Comments
Which features are you using? Normally, a If you confirm that it's coming from There is the feature
So if you use this feature, this behavior is expected, and already documented. |
Thanks for the answer If you want to inspect my test code, it is here: https://pastebin.com/raw/7iHX6QaY My hardware is Raspberry Pi 4 and OS is machine's official os (RPi OS, formely Raspbian, based on Debian) For watching process's memory I used the following command ("editor" is process's name): |
You skipped the most important part: which features are you using? If you are new to Rust, they are shown in your Cargo.toml. Looking at your pastbin, your Also, you can use |
I had written that test code on the top of my program code which uses unsafe textures without understanding that it changes the way how textures (created with ordinary calls) behave. This must explain it. Sorry to waste your time. (I still recommend being more explicit on this project's documentation page (here: https://github.com/Rust-SDL2/rust-sdl2/) that without unsafe textures feature texture memory will be freed when variables are dropped) |
There is a mention in the readme if you want to know more about
We can't state everything in the readme, that is why the docs are here and we direct to it both times it is mentioned. |
I find the documentation highly vague on this crucial issue. So I ask about it explicitly:
Is it possible to free textures (so that memory gets instantly freed) during the course of the program without using unsafe code?
I made a test where I filled a vector with elements that contain an SDL_Texture. This consumed process's memory. Then I popped the same amount of elements from the vector but this did not free any process's memory. If this was a wrong way to do it, what is the right way?
The text was updated successfully, but these errors were encountered: