[gbrainy] Fix timer for slow systems
- From: Jordi Mas <jmas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gbrainy] Fix timer for slow systems
- Date: Sun, 12 Jun 2011 18:09:20 +0000 (UTC)
commit d92a40013ff8a2fc2c110d1a3b5fa8a2041a88de
Author: Jordi Mas <jmas softcatala org>
Date: Sun Jun 12 20:08:45 2011 +0200
Fix timer for slow systems
src/Core/Main/Memory.cs | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/Core/Main/Memory.cs b/src/Core/Main/Memory.cs
index ba7db50..8dd7335 100644
--- a/src/Core/Main/Memory.cs
+++ b/src/Core/Main/Memory.cs
@@ -122,6 +122,10 @@ namespace gbrainy.Core.Main
private void TimerUpdater (object source, ElapsedEventArgs e)
{
+ // In slow systems you can get pending events after the timer is disabled
+ if (timer.Enabled == false)
+ return;
+
if (shade == false && time_left == 0) {
lock (this) {
time_left = shading_time;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]