We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug The system memory & gpu memory leaks when drawing an image. I think this only happens when drawing the image for the first time.
this bug could be connect to #1128
or maby i am doing something wrong
To Reproduce run this code best in release mode
use ggez::graphics::{DrawParam, Image, ImageFormat}; use ggez::{event, graphics, Context, GameResult}; use image::{DynamicImage, EncodableLayout}; const IMG_SIZE: u32 = 8000; struct MainState {} impl MainState { fn new(_ctx: &mut Context) -> GameResult<MainState> { Ok(MainState {}) } } impl event::EventHandler<ggez::GameError> for MainState { fn update(&mut self, _ctx: &mut Context) -> GameResult { Ok(()) } fn draw(&mut self, ctx: &mut Context) -> GameResult { let mut canvas = graphics::Canvas::from_frame(ctx, graphics::Color::from([0.1, 0.2, 0.3, 1.0])); let image = DynamicImage::new_rgb8(IMG_SIZE, IMG_SIZE); let image = Image::from_pixels( ctx, image.to_rgba8().as_bytes(), ImageFormat::Rgba8Unorm, IMG_SIZE, IMG_SIZE, ); //comment out this line of code -> no memory leak // canvas.draw(&image, DrawParam::default()); canvas.finish(ctx)?; Ok(()) } } pub fn main() -> GameResult { let cb = ggez::ContextBuilder::new("super_simple", "ggez"); let (mut ctx, event_loop) = cb.build()?; let state = MainState::new(&mut ctx)?; event::run(ctx, event_loop, state) }
Expected behavior No memory leak, image should be automatically dropped
Hardware and Software:
The text was updated successfully, but these errors were encountered:
Should be fixed with 0.9.2 so i'm gonna go ahead and close feel free to tell me to reopen if the problem still exist.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
The system memory & gpu memory leaks when drawing an image.
I think this only happens when drawing the image for the first time.
this bug could be connect to #1128
or maby i am doing something wrong
To Reproduce
run this code best in release mode
Expected behavior
No memory leak, image should be automatically dropped
Hardware and Software:
The text was updated successfully, but these errors were encountered: