[hyena] [Hyena.Gui] Fix crash-causing race in ListViewAccessible
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hyena] [Hyena.Gui] Fix crash-causing race in ListViewAccessible
- Date: Wed, 11 Aug 2010 04:14:29 +0000 (UTC)
commit 63670138b85f16318f71702d3da6b69775f81ae6
Author: Gabriel Burt <gabriel burt gmail com>
Date: Tue Aug 10 21:13:12 2010 -0700
[Hyena.Gui] Fix crash-causing race in ListViewAccessible
Proper fix for bgo#622158, ensuring the model/selection changed handlers
are run on the GUI thread. Should also fix bgo#626335
.../Accessibility/ListViewAccessible.cs | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible.cs b/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible.cs
index a9ba835..eac7041 100644
--- a/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible.cs
+++ b/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible.cs
@@ -53,9 +53,9 @@ namespace Hyena.Data.Gui.Accessibility
cell_cache = new Dictionary<int, ColumnCellAccessible> ();
- list_view.ModelChanged += (o, a) => OnModelChanged ();
- list_view.ModelReloaded += (o, a) => OnModelChanged ();
- OnModelChanged ();
+ list_view.ModelChanged += OnModelChanged;
+ list_view.ModelReloaded += OnModelChanged;
+ OnModelChanged (null, null);
list_view.SelectionProxy.FocusChanged += OnSelectionFocusChanged;
list_view.ActiveColumnChanged += OnSelectionFocusChanged;
@@ -126,7 +126,13 @@ namespace Hyena.Data.Gui.Accessibility
return RefAt (row, col);
}
- private void OnModelChanged ()
+
+ private void OnModelChanged (object o, EventArgs a)
+ {
+ ThreadAssist.ProxyToMain (EmitModelChanged);
+ }
+
+ private void EmitModelChanged ()
{
GLib.Signal.Emit (this, "model_changed");
cell_cache.Clear ();
@@ -138,6 +144,11 @@ namespace Hyena.Data.Gui.Accessibility
private void OnSelectionFocusChanged (object o, EventArgs a)
{
+ ThreadAssist.ProxyToMain (EmitDescendantChanged);
+ }
+
+ private void EmitDescendantChanged ()
+ {
var cell = ActiveCell;
if (cell != null) {
GLib.Signal.Emit (this, "active-descendant-changed", cell.Handle);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]