You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a small memory leak while developing and tracked it down partially due to when creating a new window. Here is an example code which valgrind detects a memory leak. I am on Ubuntu 22.04 testing this.
use minifb::{Window, WindowOptions};
const W: usize = 800;
const H: usize = 400;
fn main() -> Result<(), std::io::Error> {
let _window = Window::new(
&"Here is a title".to_string(),
W,
H,
WindowOptions::default(),
);
Ok(())
}
The output text from valgrind is attached here. test_minifb.txt
Valgrind states there is 244 bytes lost in this program, but the program I was developing was integrating minifb and plotters stated there was 500 bytes lost. I am currently trying to track down the other 256 bytes (and also if it grows over time).
If there is something I am doing wrong or more information needed, I would greatly appreciate any feedback. Thank you so much for your work!
The text was updated successfully, but these errors were encountered:
Thanks for the report. It might be related to some resources that isn't freed correctly during the close down of the Window. While not ideal as long as it doesn't keep leaking while running it shouldn't be a major issue as the OS will clean up the resources afterwards.
That being said it would be nice to fix it if possible.
I noticed a small memory leak while developing and tracked it down partially due to when creating a new window. Here is an example code which valgrind detects a memory leak. I am on Ubuntu 22.04 testing this.
The output text from valgrind is attached here.
test_minifb.txt
Valgrind states there is 244 bytes lost in this program, but the program I was developing was integrating minifb and plotters stated there was 500 bytes lost. I am currently trying to track down the other 256 bytes (and also if it grows over time).
If there is something I am doing wrong or more information needed, I would greatly appreciate any feedback. Thank you so much for your work!
The text was updated successfully, but these errors were encountered: