Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2006:
[Freeciv-Dev] Re: (PR#18758) [Bug] Memory leak in ai_manage_airunit()
Home

[Freeciv-Dev] Re: (PR#18758) [Bug] Memory leak in ai_manage_airunit()

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#18758) [Bug] Memory leak in ai_manage_airunit()
From: "Marko Lindqvist" <cazfi74@xxxxxxxxx>
Date: Mon, 24 Jul 2006 09:56:39 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=18758 >


  New version

  - Use refuel_iterate_end() instead of calling pq_destroy() directly



  - ML

diff -Nurd -X.diff_ignore freeciv/ai/aiair.c freeciv/ai/aiair.c
--- freeciv/ai/aiair.c  2006-07-24 15:51:53.515625000 +0300
+++ freeciv/ai/aiair.c  2006-07-24 16:31:20.015625000 +0300
@@ -266,6 +266,8 @@
     refuel_iterate_process(airbase_iterator, airbase);
   }
 
+  refuel_iterate_end(airbase_iterator);
+
   return found;
 }
 
diff -Nurd -X.diff_ignore freeciv/server/airgoto.c freeciv/server/airgoto.c
--- freeciv/server/airgoto.c    2006-07-24 15:55:07.406250000 +0300
+++ freeciv/server/airgoto.c    2006-07-24 16:30:49.671875000 +0300
@@ -325,7 +325,7 @@
 /*************************************************************************
  * Clean up
  ************************************************************************/
-static void refuel_iterate_end(struct pqueue *rp_list)
+void refuel_iterate_end(struct pqueue *rp_list)
 {
   /* No need to free memory allocated for the refuels list 
    * -- it will be reused */
diff -Nurd -X.diff_ignore freeciv/server/airgoto.h freeciv/server/airgoto.h
--- freeciv/server/airgoto.h    2006-07-24 15:55:07.406250000 +0300
+++ freeciv/server/airgoto.h    2006-07-24 16:31:03.984375000 +0300
@@ -27,6 +27,7 @@
                                    bool cities_only, int moves_left, 
                                    int moves_per_turn, int max_moves);
 struct refuel *refuel_iterate_next(struct pqueue *rp_list);
+void refuel_iterate_end(struct pqueue *rp_list);
 void refuel_iterate_process(struct pqueue *rp_list, struct refuel *pfrom);
 
 bool find_air_first_destination(struct unit *punit, struct tile **dst_tile);

[Prev in Thread] Current Thread [Next in Thread]