]> git.mxchange.org Git - flightgear.git/commitdiff
Another round of memory leak fixes from Till Busch
authortimoore <timoore>
Thu, 24 Jan 2008 23:05:58 +0000 (23:05 +0000)
committertimoore <timoore>
Thu, 24 Jan 2008 23:05:58 +0000 (23:05 +0000)
src/Cockpit/hud.cxx
src/Cockpit/hud.hxx
src/Instrumentation/HUD/HUD.hxx
src/Instrumentation/HUD/HUD_instrument.cxx
src/Instrumentation/HUD/HUD_label.cxx
src/Instrumentation/HUD/HUD_misc.cxx
src/Main/main.cxx
src/Traffic/Schedule.cxx

index 35513b45c60c503642cb750ded24820e3d280a00..606a29efb5ba7878720547cb2382aeb8a51a5431 100644 (file)
@@ -63,7 +63,7 @@ static HUD_Properties *HUDprop = 0;
 
 static char units[5];
 
-deque<instr_item *> HUD_deque;
+deque<SGSharedPtr<instr_item> > HUD_deque;
 
 fgTextList HUD_TextList;
 fgLineList HUD_LineList;
index 69759dd4fdf86158d69360dd4f337d3afdff4b76..91249e851e84ac5b97a26be2091e05745dbed1ad 100644 (file)
@@ -367,7 +367,7 @@ extern fgLineList         HUD_LineList;
 extern fgLineList         HUD_StippleLineList;
 
 
-class instr_item {  // An Abstract Base Class (ABC)
+class instr_item : public SGReferenced {  // An Abstract Base Class (ABC)
 private:
     static UINT        instances;     // More than 64K instruments? Nah!
     static int         brightness;
index d1d987dbb55424396d574336daeb36225944a29f..af8816d4785d83d8b3c8e70f8d9ebd118448c827 100644 (file)
@@ -23,6 +23,7 @@
 #define _HUD_HXX
 
 #include <simgear/compiler.h>
+#include <simgear/props/condition.hxx>
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
@@ -52,7 +53,6 @@ SG_USING_NAMESPACE(std);
 
 
 class FGViewer;
-class SGCondition;
 
 
 class LineSegment {
@@ -344,7 +344,7 @@ protected:
     float       _center_x, _center_y;
 
 private:
-    SGCondition *_condition;
+    SGSharedPtr<SGCondition> _condition;
     float       _disp_factor;   // Multiply by to get numbers shown on scale.
     float       _scr_span;      // Working values for draw;
     int         _digits;
@@ -370,7 +370,7 @@ private:
     float   _pointer_width;
     float   _pointer_length;
 
-    SGCondition *_blink_condition;
+    SGSharedPtr<SGCondition> _blink_condition;
     double  _blink_interval;
     double  _blink_target;  // time for next blink state change
     bool    _blink_state;
@@ -583,7 +583,7 @@ public:
     virtual void draw();
 
 private:
-    SGCondition *_active_condition;  // stadiametric (true) or standby (false)
+    SGSharedPtr<SGCondition> _active_condition;  // stadiametric (true) or standby (false)
     Input   _diameter;               // inner/outer radius relation
     float   _bullet_size;
     float   _inner_radius;
index b52a3e148239918231a0b6fc3bb3d1a14cc40ce5..b9bc717f45fc417f4a1d4c784a6bed1ff581f917 100644 (file)
@@ -24,7 +24,6 @@
 #endif
 
 #include <simgear/math/SGLimits.hxx>
-#include <simgear/props/condition.hxx>
 #include "HUD.hxx"
 
 
index 431b8ae985e244263aef2151d6fe70980fb522eb..3b83c9f58bbb9bf9882abd510c2563ef3d8e0d8d 100644 (file)
@@ -23,7 +23,6 @@
 #  include <config.h>
 #endif
 
-#include <simgear/props/condition.hxx>
 #include "HUD.hxx"
 
 
index d91916fca4743f2d127624924dba1b8c335317d0..021e22ba2208698c737b15b5f680d2ebf27aa313 100644 (file)
@@ -22,7 +22,6 @@
 #  include <config.h>
 #endif
 
-#include <simgear/props/condition.hxx>
 #include "HUD.hxx"
 
 
index 942b715fec05f7b1376903cb02dd7422df9a21e0..2eb7686f36bbe56c5f97ecd847e745553f82568f 100644 (file)
@@ -492,9 +492,6 @@ static void fgMainLoop( void ) {
     // Do any I/O channel work that might need to be done
     globals->get_io()->update( real_delta_time_sec );
 
-    // see if we need to load any deferred-load textures
-    globals->get_matlib()->load_next_deferred();
-
     // Run audio scheduler
 #ifdef ENABLE_AUDIO_SUPPORT
     if ( globals->get_soundmgr()->is_working() ) {
index 35a1e44c92b81a10d424f07b10ee015498268d44..ac2a305c4f2b5cc2817c7b3a628a753728b1264b 100644 (file)
@@ -231,7 +231,7 @@ bool FGAISchedule::update(time_t now)
   if (!deptime)
     deptime = (*flights.begin())->getDepartureTime();
   FGScheduledFlightVecIterator i = flights.begin();
-  SG_LOG (SG_GENERAL, SG_INFO,"Processing registration " << registration << " with callsign " << (*i)->getCallSign());
+  SG_LOG (SG_GENERAL, SG_DEBUG,"Processing registration " << registration << " with callsign " << (*i)->getCallSign());
   if (AIManagerRef)
     {
       // Check if this aircraft has been released.