summaryrefslogtreecommitdiff
path: root/src/book-view.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/book-view.vala')
-rw-r--r--src/book-view.vala27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/book-view.vala b/src/book-view.vala
index faf1199..4796ec1 100644
--- a/src/book-view.vala
+++ b/src/book-view.vala
@@ -34,7 +34,7 @@ public class BookView : Gtk.VBox
private Gtk.Adjustment adjustment;
private Gdk.CursorType cursor;
-
+
public signal void page_selected (Page? page);
public signal void show_page (Page page);
public signal void show_menu ();
@@ -85,6 +85,23 @@ public class BookView : Gtk.VBox
drawing_area.show ();
}
+ ~BookView ()
+ {
+ book.page_added.disconnect (add_cb);
+ book.page_removed.disconnect (remove_cb);
+ book.reordered.disconnect (reorder_cb);
+ book.cleared.disconnect (clear_cb);
+ drawing_area.configure_event.disconnect (configure_cb);
+ drawing_area.draw.disconnect (draw_cb);
+ drawing_area.motion_notify_event.disconnect (motion_cb);
+ drawing_area.key_press_event.disconnect (key_cb);
+ drawing_area.button_press_event.disconnect (button_cb);
+ drawing_area.button_release_event.disconnect (button_cb);
+ drawing_area.focus_in_event.disconnect (focus_cb);
+ drawing_area.focus_out_event.disconnect (focus_cb);
+ adjustment.value_changed.disconnect (scroll_cb);
+ }
+
private PageView get_nth_page (int n)
{
Page page = book.get_page (n);
@@ -221,6 +238,9 @@ public class BookView : Gtk.VBox
selected_page = null;
}
+ var page_view = page_data.lookup (page);
+ page_view.changed.disconnect (page_view_changed_cb);
+ page_view.size_changed.disconnect (page_view_size_changed_cb);
page_data.remove (page);
select_page_view (new_selection);
@@ -588,9 +608,4 @@ public class BookView : Gtk.VBox
else
return null;
}
-
- public Gtk.Widget get_event_source ()
- {
- return drawing_area;
- }
}