[Lldb-commits] [lldb] 6ac12b5 - [lldb] Destory the debugger in the Driver dtor (NFC)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 9 16:47:38 PST 2020


Author: Jonas Devlieghere
Date: 2020-11-09T16:47:30-08:00
New Revision: 6ac12b5b6c5dc2c705f6e638cf6f5d50118abe92

URL: https://github.com/llvm/llvm-project/commit/6ac12b5b6c5dc2c705f6e638cf6f5d50118abe92
DIFF: https://github.com/llvm/llvm-project/commit/6ac12b5b6c5dc2c705f6e638cf6f5d50118abe92.diff

LOG: [lldb] Destory the debugger in the Driver dtor (NFC)

Added: 
    

Modified: 
    lldb/tools/driver/Driver.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index e6b725d431f1..526afdc97eb3 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -112,7 +112,10 @@ Driver::Driver()
   g_driver = this;
 }
 
-Driver::~Driver() { g_driver = nullptr; }
+Driver::~Driver() {
+  SBDebugger::Destroy(m_debugger);
+  g_driver = nullptr;
+}
 
 void Driver::OptionData::AddInitialCommand(std::string command,
                                            CommandPlacement placement,
@@ -676,9 +679,7 @@ int Driver::MainLoop() {
   reset_stdin_termios();
   fclose(stdin);
 
-  int exit_code = sb_interpreter.GetQuitStatus();
-  SBDebugger::Destroy(m_debugger);
-  return exit_code;
+  return sb_interpreter.GetQuitStatus();
 }
 
 void Driver::ResizeWindow(unsigned short col) {


        


More information about the lldb-commits mailing list