// $Id$
+#include <simgear/sound/soundmgr_openal.hxx>
#include <simgear/structure/commands.hxx>
#include <simgear/misc/sg_path.hxx>
acmodel( NULL ),
model_mgr( NULL ),
channel_options_list( NULL ),
+ initial_waypoints(0),
scenery( NULL ),
tile_mgr( NULL ),
- io( new FGIO ),
- initial_waypoints(0)
+ io( new FGIO )
{
}
// Destructor
FGGlobals::~FGGlobals()
{
- delete subsystem_mgr;
- delete event_mgr;
- delete initial_state;
- delete props;
- delete commands;
- delete io;
+ delete soundmgr;
+ delete subsystem_mgr;
+ delete event_mgr;
+ delete initial_state;
+ delete props;
+ delete commands;
+ delete io;
- // make sure only to delete the initial waypoints list if it acually
- // still exists.
- if (initial_waypoints)
- delete initial_waypoints;
+ // make sure only to delete the initial waypoints list if it acually
+ // still exists.
+ if (initial_waypoints)
+ delete initial_waypoints;
}
}
+
+// do some clean up on exit. Specifically we want to call alutExit()
+// which happens in the sound manager destructor.
+void fgExitCleanup() {
+ delete globals;
+}
+
+
// Main top level initialization
bool fgMainInit( int argc, char **argv ) {
// set default log levels
sglog().setLogLevels( SG_ALL, SG_ALERT );
+ atexit(fgExitCleanup);
+
string version;
#ifdef FLIGHTGEAR_VERSION
version = FLIGHTGEAR_VERSION;
// close the channel
bool FGAtlas::close() {
+ SG_LOG( SG_IO, SG_INFO, "closing FGAtlas" );
SGIOChannel *io = get_io_channel();
set_enabled( false );
bool FGHttpd::close() {
- delete server;
+ SG_LOG( SG_IO, SG_INFO, "closing FGHttpd" );
+
+ // the following delete causes a seg fault, gdb is not helpful.
+ // delete server;
+
+ set_enabled( false );
return true;
}
bool
FGProps::close()
{
+ SG_LOG( SG_IO, SG_INFO, "closing FGProps" );
return true;
}