aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/breakhandler.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2019-11-22 16:55:53 +0100
committerhjk <[email protected]>2019-11-28 09:08:51 +0000
commit70aab593bd84f6968abe6c5a3c8e37ba6701f500 (patch)
tree6a2f621756917ce416e0bb0982a36bd7237051b1 /src/plugins/debugger/breakhandler.cpp
parent6b1d54421e3831576c8d169bf38caf1ab503c84a (diff)
Debugger: Delete breakpoint markers on session switch
There were some left-over "ghost markers" when switching sessions, which should be gone now. This also pointed to a wrong use of SessionManager::aboutToUnloadSession which mustn't save data re-created in a save/load cycle as it is called during any session load, including the very first on startup no such data (e.g. breakpoints) have been created yet. Change-Id: I237a9e3500a786841618941ce85a97f7bd4f318c Fixes: QTCREATORBUG-22856 Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/debugger/breakhandler.cpp')
-rw-r--r--src/plugins/debugger/breakhandler.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp
index 6015f29decc..f393bcff4ad 100644
--- a/src/plugins/debugger/breakhandler.cpp
+++ b/src/plugins/debugger/breakhandler.cpp
@@ -2114,7 +2114,10 @@ GlobalBreakpointItem::GlobalBreakpointItem()
}
GlobalBreakpointItem::~GlobalBreakpointItem()
-{}
+{
+ delete m_marker;
+ m_marker = nullptr;
+}
QVariant GlobalBreakpointItem::data(int column, int role) const
{
@@ -2414,8 +2417,6 @@ BreakpointManager::BreakpointManager()
this, &BreakpointManager::loadSessionData);
connect(SessionManager::instance(), &SessionManager::aboutToSaveSession,
this, &BreakpointManager::saveSessionData);
- connect(SessionManager::instance(), &SessionManager::aboutToUnloadSession,
- this, &BreakpointManager::aboutToUnloadSession);
}
QAbstractItemModel *BreakpointManager::model()
@@ -2797,12 +2798,6 @@ void BreakpointManager::saveSessionData()
SessionManager::setValue("Breakpoints", list);
}
-void BreakpointManager::aboutToUnloadSession()
-{
- saveSessionData();
- clear();
-}
-
void BreakpointManager::loadSessionData()
{
clear();