aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/TabView.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/GraphicObjects/TabView.cs')
-rw-r--r--src/GraphicObjects/TabView.cs21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/GraphicObjects/TabView.cs b/src/GraphicObjects/TabView.cs
index c5292da7..abaa6ac0 100644
--- a/src/GraphicObjects/TabView.cs
+++ b/src/GraphicObjects/TabView.cs
@@ -176,17 +176,20 @@ namespace Crow
gr.Clip ();
}
- lock (Children) {
- TabItem[] tabItms = Children.Cast<TabItem> ().OrderBy (t => t.ViewIndex).ToArray ();
- for (int i = 0; i < tabItms.Length; i++) {
- if (tabItms [i] == Children [SelectedTab])
- continue;
- tabItms [i].Paint (ref gr);
- }
+ childrenRWLock.EnterReadLock ();
- if (SelectedTab < tabItms.Length && SelectedTab >= 0)
- Children [SelectedTab].Paint (ref gr);
+ TabItem[] tabItms = Children.Cast<TabItem> ().OrderBy (t => t.ViewIndex).ToArray ();
+ for (int i = 0; i < tabItms.Length; i++) {
+ if (tabItms [i] == Children [SelectedTab])
+ continue;
+ tabItms [i].Paint (ref gr);
}
+
+ if (SelectedTab < tabItms.Length && SelectedTab >= 0)
+ Children [SelectedTab].Paint (ref gr);
+
+ childrenRWLock.ExitReadLock ();
+
gr.Restore ();
}