diff options
author | Ville Hakulinen <ville.hakulinen@gmail.com> | 2020-07-07 19:05:55 +0300 |
---|---|---|
committer | Ville Hakulinen <ville.hakulinen@gmail.com> | 2020-07-12 01:57:30 +0300 |
commit | 955e8f79bd345e330a28fe276e53df54c28b1244 (patch) | |
tree | 076d765637f520c4185c67eeb165687563928dc8 | |
parent | a49e0ced15459ad19b70d2ad6bce1030202b7991 (diff) |
Remove calls to gobject's destroy
These destroy functions are marked as unsafe in newer version of gtk-rs
-rw-r--r-- | src/ui/grid/grid.rs | 7 | ||||
-rw-r--r-- | src/ui/state.rs | 1 | ||||
-rw-r--r-- | src/ui/window.rs | 5 |
3 files changed, 2 insertions, 11 deletions
diff --git a/src/ui/grid/grid.rs b/src/ui/grid/grid.rs index 687a9d9..c4dbc3b 100644 --- a/src/ui/grid/grid.rs +++ b/src/ui/grid/grid.rs @@ -520,13 +520,6 @@ impl Grid { } } -impl Drop for Grid { - fn drop(&mut self) { - // TODO(ville): Test that we release all resources. - self.eb.destroy(); - } -} - /// Handler for grid's drawingarea's draw event. Draws the internal cairo /// context (`ctx`) surface to the `cr`. fn drawingarea_draw(cr: &cairo::Context, ctx: &mut Context) { diff --git a/src/ui/state.rs b/src/ui/state.rs index fbde150..713dd67 100644 --- a/src/ui/state.rs +++ b/src/ui/state.rs @@ -203,7 +203,6 @@ impl UIState { } fn grid_destroy(&mut self, grid: &i64) { - // TODO(ville): Make sure all grid resources are freed. self.grids.remove(grid).unwrap(); // Drop grid. if self.windows.contains_key(grid) { self.windows.remove(grid).unwrap(); // Drop window that the grid belongs to. diff --git a/src/ui/window.rs b/src/ui/window.rs index 3418980..7fddbb2 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -163,17 +163,16 @@ impl Window { impl Drop for Window { fn drop(&mut self) { - // TODO(ville): Test that we release all resources. if let Some(child) = self.frame.get_child() { // We don't want to destroy the child widget, so just remove the child from our // container. self.frame.remove(&child); } - self.frame.destroy(); + self.fixed.remove(&self.frame); if let Some(ref win) = self.external_win { - win.destroy(); + win.close(); } } } |