Rename free_*_graphics_resources to unregister_component

I want a more generic name as I want to do to track component structure
changes in addition to resource freeing and I do not want to add another
call into the generated code.
This commit is contained in:
Tobias Hunger 2022-06-29 14:38:04 +02:00 committed by Tobias Hunger
parent 539dec2962
commit 581533f302
13 changed files with 25 additions and 24 deletions

View file

@ -1127,7 +1127,7 @@ fn generate_item_tree(
let mut destructor = vec!["auto self = this;".to_owned()];
destructor.push(format!(
"{}->m_window.window_handle().free_graphics_resources(self, item_array());",
"{}->m_window.window_handle().unregister_component(self, item_array());",
root_access
));

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
// cSpell: ignore conv powf punct
// cSpell: ignore conv gdata powf punct vref
/*! module for the Rust code generator
@ -1220,7 +1220,7 @@ fn generate_item_tree(
fn drop(self: core::pin::Pin<&mut #inner_component_id>) {
use slint::re_exports::*;
new_vref!(let vref : VRef<ComponentVTable> for Component = self.as_ref().get_ref());
slint::re_exports::free_component_item_graphics_resources(self.as_ref(), vref, Self::item_array(), self.window.get().unwrap().window_handle());
slint::re_exports::unregister_component(self.as_ref(), vref, Self::item_array(), self.window.get().unwrap().window_handle());
}
}