Comments (4)
if the vec is extended when another
use_hook
is called, previous references will point to some invalid addrs ?
If we used references returned by vec
then yes, but we use the pointer into the bump arena which is stable between vec pushes. Similar to Box::pin
-ing the value and then returning the reference into the heap.
from dioxus.
Hooks get freed here:
self.hook_arena.reset();
self.hook_vals.get_mut().drain(..).for_each(|state| {
let as_mut = unsafe { &mut *state };
let boxed = unsafe { bumpalo::boxed::Box::from_raw(as_mut) };
drop(boxed);
});
dioxus/packages/core/src/scopes.rs
Lines 895 to 900 in fa70dd5
If the hooks don't get freed (through a panic?) then it's a memory leak
from dioxus.
if the vec is extended when another use_hook
is called, previous references will point to some invalid addrs ?
let state1 = use_hook(xxx)
...
// many use_hooks
// self.hook_vals extended
...
let staten = use_hook(xxx)
from dioxus.
Got it. I didn't look into it carefully.
let raw_box = unsafe { &mut **inn };
from dioxus.
Related Issues (20)
- Error compiling desktop project on linux (`linking with 'cc' failed`) HOT 3
- Replacing Text with Node Fails HOT 1
- Tailwind CSS example: including stylesheets using the mg! not work.
- Inline rsx within match never reevaluated when on of the arm's returns an empty rsx. HOT 2
- Error when calling "cargo clippy --workspace --examples --tests -- -D warnings"
- Clean up our core-macro implementation.
- Tokio version appears to be mising new_multi_thread fresh install with LiveView 0.5.0-alpha.0 HOT 1
- Hotreload poll causes server_futures to repeatedly get called HOT 1
- Move over to typed-builder instead of using its source directly
- Weird error with new signals lifetimes
- Move away from global event converter
- Move eval infrastructure into the base interpreter
- The event mounted interface is clunky - we should swap to a NodeRef approach
- Elements should be easier to extend
- Collapse events to `Event<dyn Data>`
- Form values should return a Vec of values HOT 4
- Hot reload disconnect loops when SSR takes more than 1sec HOT 1
- High CPU Load and Freeze HOT 1
- VSCode Extention Update and OpenVSX Integration
- Allow running dioxus-cli without rustup installed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dioxus.