Fix leak in render macro
This commit is contained in:
9 files changed
+197
-114
No files matched your search
+12
-6
@@ -139,9 +139,7 @@ impl ToTokens for RenderCallBody {
|
||||
out_tokens.append_all(quote! {
|
||||
Some({
|
||||
let __cx = cx;
|
||||
let __element = { #body };
|
||||
cx.link_node(&__element);
|
||||
__element
|
||||
#body
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -256,10 +254,18 @@ impl<'a> ToTokens for TemplateRenderer<'a> {
|
||||
node_paths: &[ #(#node_paths),* ],
|
||||
attr_paths: &[ #(#attr_paths),* ],
|
||||
};
|
||||
::dioxus::core::VNode::new(
|
||||
// <<<<<<< HEAD
|
||||
// ::dioxus::core::VNode::new(
|
||||
// #key_tokens,
|
||||
// TEMPLATE,
|
||||
// dioxus::core::exports::bumpalo::collections::Vec::with_capacity_in(#root_count, __cx.bump()),
|
||||
// =======
|
||||
__cx.vnode(
|
||||
None,
|
||||
#key_tokens,
|
||||
TEMPLATE,
|
||||
dioxus::core::exports::bumpalo::collections::Vec::with_capacity_in(#root_count, __cx.bump()),
|
||||
std::cell::Cell::new(TEMPLATE),
|
||||
dioxus::core::exports::bumpalo::collections::Vec::with_capacity_in(#root_count, __cx.bump()).into(),
|
||||
// >>>>>>> 9fe172e9 (Fix leak in render macro)
|
||||
__cx.bump().alloc([ #( #node_printer ),* ]),
|
||||
__cx.bump().alloc([ #( #dyn_attr_printer ),* ]),
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user