BareMetal: Fix broken remote setup

After 62c6a07445 BareMetalDebugSupport()
object creates on stack and destroys on expression end. So, remote
setup does not work. Simple create it on heap. It will be cleaned up
when RunControl object destroys.

Change-Id: I7565d22e27e158d57a4764111befe74892b64356
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Alexander Drozdov
2016-05-05 17:50:54 +10:00
parent 16063554da
commit d6f351b689

View File

@@ -135,9 +135,8 @@ RunControl *BareMetalRunControlFactory::create(
sp.remoteSetupNeeded = true;
DebuggerRunControl *runControl = createDebuggerRunControl(sp, rc, errorMessage, mode);
if (runControl && sp.remoteSetupNeeded) {
(void) BareMetalDebugSupport(runControl);
}
if (runControl && sp.remoteSetupNeeded)
new BareMetalDebugSupport(runControl);
return runControl;
}