Fix crash when hopping between years while still loading calendars
The application crashes consistently for me if I switch to last year while the calendars are still loading. The error is:
GcalTimeline:ERROR:../src/core/gcal-timeline.c:593:on_calendar_monitor_completed_cb: assertion failed: (self->completed_calendars <= g_hash_table_size (self->calendars))
This code change prevents the completed_calendars
variable from being
decremented. I can't see a reason why this value should ever need to be
decremented (you can't uncomplete some calendars).
A further thing to note is that completed_calendars
is signed while
g_hash_table_size
returns an unsigned integer. The error here occurs
because of the implicit casting (self->completed_calendars can be
negative) I believe.