mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
Use weak references in some closures
This commit is contained in:
parent
80f5047369
commit
486dbd7cbb
2 changed files with 5 additions and 5 deletions
|
|
@ -40,11 +40,11 @@ impl Screen<(), LoginData> for LoginDialog {
|
||||||
|
|
||||||
// Connect signals and callbacks
|
// Connect signals and callbacks
|
||||||
|
|
||||||
cancel_button.connect_clicked(clone!(@strong this => move |_| {
|
cancel_button.connect_clicked(clone!(@weak this => move |_| {
|
||||||
this.handle.pop(None);
|
this.handle.pop(None);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
login_button.connect_clicked(clone!(@strong this => move |_| {
|
login_button.connect_clicked(clone!(@weak this => move |_| {
|
||||||
this.widget.set_visible_child_name("loading");
|
this.widget.set_visible_child_name("loading");
|
||||||
|
|
||||||
let data = LoginData {
|
let data = LoginData {
|
||||||
|
|
@ -65,7 +65,7 @@ impl Screen<(), LoginData> for LoginDialog {
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
register_button.connect_clicked(clone!(@strong this => move |_| {
|
register_button.connect_clicked(clone!(@weak this => move |_| {
|
||||||
let context = glib::MainContext::default();
|
let context = glib::MainContext::default();
|
||||||
let clone = this.clone();
|
let clone = this.clone();
|
||||||
context.spawn_local(async move {
|
context.spawn_local(async move {
|
||||||
|
|
|
||||||
|
|
@ -50,11 +50,11 @@ impl Screen<(), LoginData> for RegisterDialog {
|
||||||
|
|
||||||
// Connect signals and callbacks
|
// Connect signals and callbacks
|
||||||
|
|
||||||
cancel_button.connect_clicked(clone!(@strong this => move |_| {
|
cancel_button.connect_clicked(clone!(@weak this => move |_| {
|
||||||
this.handle.pop(None);
|
this.handle.pop(None);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
register_button.connect_clicked(clone!(@strong this => move |_| {
|
register_button.connect_clicked(clone!(@weak this => move |_| {
|
||||||
let password = this.password_entry.get_text().unwrap().to_string();
|
let password = this.password_entry.get_text().unwrap().to_string();
|
||||||
let repeat = this.repeat_password_entry.get_text().unwrap().to_string();
|
let repeat = this.repeat_password_entry.get_text().unwrap().to_string();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue