nannou
nannou copied to clipboard
draw.text() memory leak
Hi,
when I use draw.text()
my nannou app starts to consume endless memory. That means the memory usage grows and grows until all the memory of my ram is gone. I am on Ubuntu 21.04 with Rust 1.54 and Nannou 0.17.
Here is a minimal example where the bug appears:
use nannou::prelude::*;
fn main() {
nannou::app(model).update(update).simple_window(view).run();
}
struct Model {}
fn model(_app: &App) -> Model {
Model {}
}
fn update(_app: &App, _model: &mut Model, _update: Update) {}
fn view(_app: &App, model: &Model, frame: Frame) {
let draw = _app.draw();
draw.background().color(WHITE);
let text: &str = "hello";
draw.text(text).color(BLACK);
draw.to_frame(_app, &frame).unwrap();
}
What am I doing wrong? Thank you very much.
Possibly related to #761 though yet to confirm.
As a workaround for now one can use
[patch.crates-io.wgpu]
git = "https://github.com/mitchmindtree/wgpu-rs"
branch = "0.8-as-0.9"
in the Cargo.toml
. (downgrade wgpu to 0.8)
Fixes the leak for me.
Thanks a lot to @mitchmindtree
It seems like this has been fixed in nannou 0.18.1
, should this be closed?