Trait godot_core::obj::NewAlloc

source ·
pub trait NewAlloc: GodotClass {
    // Required method
    fn new_alloc() -> Gd<Self>;
}
Expand description

Extension trait for all manually managed classes.

Required Methods§

source

fn new_alloc() -> Gd<Self>

Return a new, manually-managed Gd containing a default-constructed instance.

The result must be manually managed, e.g. by attaching it to the scene tree or calling free() after usage. Failure to do so will result in memory leaks.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> NewAlloc for T
where T: GodotDefault + Bounds<Memory = MemManual>,