[longomatch] Add a safety check to prevent a crash.
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Add a safety check to prevent a crash.
- Date: Wed, 18 Mar 2015 14:43:18 +0000 (UTC)
commit 2131b0db5032c39bb8f0fd5913ef08114f85c611
Author: Julien Moutte <julien fluendo com>
Date: Sat Mar 14 13:48:10 2015 +0100
Add a safety check to prevent a crash.
Looks like we can get disposed twice and Objects could be null in ClearSelection if we call it once
disposed.
LongoMatch.Drawing/Canvas.cs | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/LongoMatch.Drawing/Canvas.cs b/LongoMatch.Drawing/Canvas.cs
index 3b05532..affce58 100644
--- a/LongoMatch.Drawing/Canvas.cs
+++ b/LongoMatch.Drawing/Canvas.cs
@@ -62,6 +62,7 @@ namespace LongoMatch.Drawing
protected virtual void Dispose (bool disposing)
{
+ // FIXME: Should we check if we are disposed already ?
if (disposing) {
ClearObjects ();
Objects = null;
@@ -271,8 +272,10 @@ namespace LongoMatch.Drawing
ICanvasSelectableObject po = sel.Drawable as ICanvasSelectableObject;
po.Selected = false;
}
- foreach (ICanvasSelectableObject cso in Objects) {
- cso.Selected = false;
+ if (Objects != null) {
+ foreach (ICanvasSelectableObject cso in Objects) {
+ cso.Selected = false;
+ }
}
Selections.Clear ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]