The UserSettings controllers must be initialized & terminated in the
correct order.  Previously this was tacitly implemented but not
enforced, so it was possible to accidentally do things in the wrong
order and cause problems.  This fixes that problem.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127430 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/lldb.cpp b/source/lldb.cpp
index e1b54e9..699c394 100644
--- a/source/lldb.cpp
+++ b/source/lldb.cpp
@@ -74,9 +74,6 @@
         Timer::Initialize ();
         Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);
         
-        Target::Initialize ();
-        Process::Initialize ();
-        Thread::Initialize ();
         DisassemblerLLVM::Initialize();
         ObjectContainerBSDArchive::Initialize();
         ObjectFileELF::Initialize();
@@ -112,9 +109,10 @@
         // Scan for any system or user LLDB plug-ins
         PluginManager::Initialize();
 
-        // The process needs to know about installed plug-ins
-        Process::DidInitialize ();
-
+        // The process settings need to know about installed plug-ins, so the Settings must be initialized
+        // AFTER PluginManager::Initialize is called.
+        
+        Debugger::SettingsInitialize();
     }
 }
 
@@ -157,9 +155,7 @@
     PlatformMacOSX::Terminate();
 #endif
 
-    Thread::Terminate ();
-    Process::Terminate ();
-    Target::Terminate ();
+    Debugger::SettingsTerminate ();
 
 #if defined (__linux__)
     PlatformLinux::Terminate();