[longomatch] Make sure we clear selection before clearing objects.
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Make sure we clear selection before clearing objects.
- Date: Wed, 18 Mar 2015 14:42:42 +0000 (UTC)
commit fda02ec1f07006e8a006c9f30ca2510a2a2c008d
Author: Julien Moutte <julien fluendo com>
Date: Sat Mar 14 09:36:47 2015 +0100
Make sure we clear selection before clearing objects.
Indeed for a SelectionCanvas we could end up with invalid objects in the cached selection as ClearObjects
does not clear the selection cache.
LongoMatch.Drawing/Canvas.cs | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.Drawing/Canvas.cs b/LongoMatch.Drawing/Canvas.cs
index 316d851..3b05532 100644
--- a/LongoMatch.Drawing/Canvas.cs
+++ b/LongoMatch.Drawing/Canvas.cs
@@ -69,7 +69,7 @@ namespace LongoMatch.Drawing
}
}
- protected void ClearObjects ()
+ protected virtual void ClearObjects ()
{
if (Objects != null) {
foreach (ICanvasObject co in Objects) {
@@ -180,6 +180,13 @@ namespace LongoMatch.Drawing
base.Dispose (disposing);
}
+ protected override void ClearObjects ()
+ {
+ // Make sure we don't maintain a selection with invalid objects.
+ ClearSelection ();
+ base.ClearObjects ();
+ }
+
public int ClickRepeatMS {
get;
set;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]