Re: [AD] al_stop/al_uninstall_timer later fails

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 21 April 2010 08:15, Trent Gamblin <trent@xxxxxxxxxx> wrote:
> With my recent change to the AQueue driver, I noticed that when I manually call
> al_stop_timer and then al_uninstall_timer on a timer that was running, during
> al_uninstall_system it tries to destruct that timer again, resulting in a crash. Any
> more info you need I'd be happy to provide.

I can't reproduce it with ex_timer.

Peter

diff --git a/examples/ex_timer.c b/examples/ex_timer.c
index fba74ca..8c9d08b 100644
--- a/examples/ex_timer.c
+++ b/examples/ex_timer.c
@@ -198,5 +198,8 @@ int main(void)

    cleanup();

+   al_uninstall_timer(timer);
+   al_uninstall_system();
+
    return 0;
 }
diff --git a/src/timernu.c b/src/timernu.c
index a2d3f44..5ae5d70 100644
--- a/src/timernu.c
+++ b/src/timernu.c
@@ -16,6 +16,7 @@
  */


+#include <stdio.h>
 #include <stdlib.h>

 #include "allegro5/allegro5.h"
@@ -183,6 +184,8 @@ ALLEGRO_TIMER* al_install_timer(double speed_secs)
  */
 void al_uninstall_timer(ALLEGRO_TIMER *timer)
 {
+   fprintf(stderr, "al_uninstall_timer: %p\n", timer);
+
    if (timer) {
       al_stop_timer(timer);




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/