window: Don't store window to avoid ref cycles
Use root() instead and move one constructor to on root for having the root available.
This commit is contained in:
parent
8345640757
commit
b9f22ebfc3
12 changed files with 77 additions and 51 deletions
|
|
@ -82,7 +82,7 @@ mod imp {
|
|||
}
|
||||
|
||||
fn activate(&self) {
|
||||
log::trace!("Activate");
|
||||
log::debug!("Showing window via 'activate'");
|
||||
let application = self.obj();
|
||||
let window = LpWindow::new(&*application);
|
||||
window.present();
|
||||
|
|
@ -138,6 +138,7 @@ impl LpApplication {
|
|||
gio::ActionEntryBuilder::new("new-window")
|
||||
.activate(|app: &Self, _, _| {
|
||||
let win = LpWindow::new(app);
|
||||
log::debug!("Showing new window");
|
||||
win.present();
|
||||
})
|
||||
.build(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue