Commits (2)
  • gambas's avatar
    Automatically disable timers when raising the 'Timer' event is impossible... · 8ae88c2d
    gambas authored
    Automatically disable timers when raising the 'Timer' event is impossible because the parent object is invalid.
    
    [INTERPRETER]
    * BUG: Automatically disable timers when raising the 'Timer' event is impossible because the parent object is invalid.
    8ae88c2d
  • gambas's avatar
    Check if the event loop must be stopped each time a timer is disabled. · 0b3d48b6
    gambas authored
    [GB.GTK]
    * BUG: Check if the event loop must be stopped each time a timer is disabled.
    
    [GB.GTK3]
    * BUG: Check if the event loop must be stopped each time a timer is disabled.
    
    [GB.QT4]
    * BUG: Check if the event loop must be stopped each time a timer is disabled.
    
    [GB.QT5]
    * BUG: Check if the event loop must be stopped each time a timer is disabled.
    0b3d48b6
......@@ -531,8 +531,9 @@ static void hook_timer(GB_TIMER *timer,bool on)
id->timeout = timer->delay;
id->source = (intptr_t)g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, timer->delay, (GSourceFunc)hook_timer_function, (gpointer)timer, NULL);
timer->id = (intptr_t)id;
return;
}
else
MAIN_check_quit();
}
static void hook_post(void)
......
......@@ -544,9 +544,9 @@ static void hook_timer(GB_TIMER *timer,bool on)
id->timeout = timer->delay;
id->source = (intptr_t)g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, timer->delay, (GSourceFunc)hook_timer_function, (gpointer)timer, NULL);
timer->id = (intptr_t)id;
//fprintf(stderr, "start: delay = %d\n", timer->delay);
return;
}
else
MAIN_check_quit();
}
static void hook_post(void)
......
......@@ -1082,6 +1082,8 @@ static void hook_timer(GB_TIMER *timer, bool on)
if (on)
timer->id = (intptr_t)(new MyTimer(timer));
else
MAIN_check_quit();
}
......
......@@ -846,6 +846,8 @@ static void hook_timer(GB_TIMER *timer, bool on)
if (on)
timer->id = (intptr_t)(new MyTimer(timer));
else
MAIN_check_quit();
}
......
......@@ -53,6 +53,7 @@ static void enable_timer(CTIMER *_object, bool on)
GB_Error("Too many active timers");
CTIMER_active_count += on ? 1 : -1;
//fprintf(stderr, "enable_timer: %d\n", CTIMER_active_count);
}
......@@ -87,7 +88,8 @@ void CTIMER_raise(void *_object)
}
else
{
if (!GB_Raise(THIS, EVENT_Timer, 0))
void *parent = OBJECT_parent(THIS);
if (parent && OBJECT_is_valid(parent) && !GB_Raise(THIS, EVENT_Timer, 0))
return;
}
}
......