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 have simplified the code a bit, but both leak memory:
#![allow(non_snake_case)]use dioxus::prelude::dioxus_core::NoOpMutations;use dioxus::prelude::*;fnmain() -> Result<(),Box<dyn std::error::Error>>{fnapp() -> Element{letmut count = use_signal(|| 0);use_hook(|| spawn(asyncmove{loop{
tokio::time::sleep(std::time::Duration::from_nanos(1)).await;let val = *count.peek_unchecked();if val == 70{
count.set(0);}else{
count.set(val + 1);}}}));rsx!{for el in 0..*count.read(){
div {
key:"{el}",
div {
onclick: move |_| { println!("click");},}}}}}// create the vdom, the real_dom, and the binding layer between themletmut vdom = VirtualDom::new(app);
vdom.rebuild(&mutNoOpMutations);// we need to run the vdom in a async runtime
tokio::runtime::Builder::new_current_thread().enable_all().build()?
.block_on(async{loop{// wait for the vdom to update
vdom.wait_for_work().await;// get the mutations from the vdom
vdom.render_immediate(&mutNoOpMutations);}})}
counter5.exe is same code running with Dioxus 0.5. and counter.exe is with 0.6.
The text was updated successfully, but these errors were encountered:
Same issue as in #2272
I have simplified the code a bit, but both leak memory:
counter5.exe
is same code running with Dioxus 0.5. andcounter.exe
is with 0.6.The text was updated successfully, but these errors were encountered: