When running a single test case, lldb.SBDebugger.Terminate() is not being called
because unittest.main() calls sys.exit() before returning.  Fixed by registering
an exit handler for this situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110379 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/global_variables/TestGlobalVariables.py b/test/global_variables/TestGlobalVariables.py
index 2701df9..36ddf65 100644
--- a/test/global_variables/TestGlobalVariables.py
+++ b/test/global_variables/TestGlobalVariables.py
@@ -54,6 +54,7 @@
 
 
 if __name__ == '__main__':
+    import atexit
     lldb.SBDebugger.Initialize()
+    atexit.register(lambda: lldb.SBDebugger.Terminate())
     unittest.main()
-    lldb.SBDebugger.Terminate()