Mercurial > geeqie
diff src/thumb_standard.c @ 1523:24a12aa0cb54
Fix up event source ids type: gint -> guint.
Functions like g_timeout_add() or g_idle_add() return a guint
greater than 0, but in most places it was wrongly stored as int
and initialized to -1.
This broke assertions matching in g_source_remove() for example
since id was always greater than 0 even when timer was not set
(-1 was casted to the biggest guint).
author | zas_ |
---|---|
date | Mon, 06 Apr 2009 22:13:54 +0000 |
parents | 68b73d524ca3 |
children | c776b1310ca6 |
line wrap: on
line diff
--- a/src/thumb_standard.c Mon Apr 06 21:52:49 2009 +0000 +++ b/src/thumb_standard.c Mon Apr 06 22:13:54 2009 +0000 @@ -738,7 +738,7 @@ void (*func_valid)(const gchar *path, gboolean valid, gpointer data); gpointer data; - gint idle_id; + guint idle_id; /* event source id */ }; static void thumb_loader_std_thumb_file_validate_free(ThumbValidate *tv) @@ -756,8 +756,11 @@ tv = tl->data; - if (tv->idle_id != -1) g_source_remove(tv->idle_id); - tv->idle_id = -1; + if (tv->idle_id) + { + g_source_remove(tv->idle_id); + tv->idle_id = 0; + } thumb_loader_std_thumb_file_validate_free(tv); } @@ -835,7 +838,7 @@ { ThumbValidate *tv = data; - tv->idle_id = -1; + tv->idle_id = 0; thumb_loader_std_thumb_file_validate_finish(tv, FALSE); return FALSE; @@ -868,7 +871,7 @@ } else { - tv->idle_id = -1; + tv->idle_id = 0; } return tv->tl;