Re: [AD] A small bugfix in allegro_exit

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


> I don't know if this is right, but shouldn't allegro_exit clear the
> exit_func list?

--- allegro.c.old	2003-05-31 19:09:40.000000000 +0000
+++ allegro.c	2003-05-31 19:15:02.000000000 +0000
@@ -371,6 +371,18 @@
    while (exit_func_list)
       (*(exit_func_list->funcptr))();
 
+   /* clear the exit func list */
+   {
+      struct al_exit_func *n = exit_func_list;
+      while (n) {
+        struct al_exit_func *next = n->next;
+        free(n);
+        n = next;
+      }
+      exit_func_list = NULL;
+   }
+
+
    if (system_driver) {
       system_driver->exit();
       system_driver = NULL;


I'd suggest to take a look at the assembly files produced by the compiler 
before and after the patch: a very good compiler should be able to prove 
that your code will never be executed and thus produce an identical assembly 
output in both cases.

-- 
Eric Botcazou




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