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/Target/Thread.cpp b/source/Target/Thread.cpp
index af2de6b..6c1dc40 100644
--- a/source/Target/Thread.cpp
+++ b/source/Target/Thread.cpp
@@ -1006,18 +1006,26 @@
void
-Thread::Initialize ()
+Thread::SettingsInitialize ()
{
UserSettingsControllerSP &usc = GetSettingsController();
usc.reset (new SettingsController);
UserSettingsController::InitializeSettingsController (usc,
SettingsController::global_settings_table,
SettingsController::instance_settings_table);
+
+ // Now call SettingsInitialize() on each 'child' setting of Thread.
+ // Currently there are none.
}
void
-Thread::Terminate ()
+Thread::SettingsTerminate ()
{
+ // Must call SettingsTerminate() on each 'child' setting of Thread before terminating Thread settings.
+ // Currently there are none.
+
+ // Now terminate Thread Settings.
+
UserSettingsControllerSP &usc = GetSettingsController();
UserSettingsController::FinalizeSettingsController (usc);
usc.reset();