summaryrefslogtreecommitdiff
path: root/src/VBox/Debugger/VBoxDbgGui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Debugger/VBoxDbgGui.cpp')
-rw-r--r--src/VBox/Debugger/VBoxDbgGui.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/VBox/Debugger/VBoxDbgGui.cpp b/src/VBox/Debugger/VBoxDbgGui.cpp
index d2f7f451..9cf91bf2 100644
--- a/src/VBox/Debugger/VBoxDbgGui.cpp
+++ b/src/VBox/Debugger/VBoxDbgGui.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2006-2010 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -32,7 +32,7 @@
VBoxDbgGui::VBoxDbgGui() :
m_pDbgStats(NULL), m_pDbgConsole(NULL), m_pSession(NULL), m_pConsole(NULL),
- m_pMachineDebugger(NULL), m_pMachine(NULL), m_pVM(NULL),
+ m_pMachineDebugger(NULL), m_pMachine(NULL), m_pUVM(NULL),
m_pParent(NULL), m_pMenu(NULL),
m_x(0), m_y(0), m_cx(0), m_cy(0), m_xDesktop(0), m_yDesktop(0), m_cxDesktop(0), m_cyDesktop(0)
{
@@ -40,12 +40,12 @@ VBoxDbgGui::VBoxDbgGui() :
}
-int VBoxDbgGui::init(PVM pVM)
+int VBoxDbgGui::init(PUVM pUVM)
{
/*
* Set the VM handle and update the desktop size.
*/
- m_pVM = pVM;
+ m_pUVM = pUVM; /* Note! This eats the incoming reference to the handle! */
updateDesktopSize();
return VINF_SUCCESS;
@@ -78,9 +78,12 @@ int VBoxDbgGui::init(ISession *pSession)
hrc = m_pMachineDebugger->COMGETTER(VM)(&llVM);
if (SUCCEEDED(hrc))
{
- rc = init((PVM)(intptr_t)llVM);
+ PUVM pUVM = (PUVM)(intptr_t)llVM;
+ rc = init(pUVM);
if (RT_SUCCESS(rc))
return rc;
+
+ VMR3ReleaseUVM(pUVM);
}
/* damn, failure! */
@@ -136,7 +139,11 @@ VBoxDbgGui::~VBoxDbgGui()
m_pSession = NULL;
}
- m_pVM = NULL;
+ if (m_pUVM)
+ {
+ VMR3ReleaseUVM(m_pUVM);
+ m_pUVM = NULL;
+ }
}
void