Skip to content

Commit e85aa3d

Browse files
committed
Fixed bugs: packet manager does not keep a reference to the filter (and can thus outlive it); packet managers not cleared when session is cleared
1 parent fdbf546 commit e85aa3d

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

release-notes/v0.1-rc2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This should be very close to the final v0.1 release.
44

55
Known bugs:
6+
* Heap use-after-free during file load of UART decode (https://github.com/ngscopeclient/scopehal-apps/issues/876, fixed in git HEAD)
67
* MacOS binary packaging is not finished (https://github.com/ngscopeclient/scopehal-apps/issues/743)
78
* Application icon is not finished (https://github.com/ngscopeclient/scopehal-apps/issues/204)
89
* Docking anchors act funny on MacOS (https://github.com/ngscopeclient/scopehal-apps/issues/871)

src/ngscopeclient/PacketManager.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ PacketManager::PacketManager(PacketDecoder* pd, Session& session)
4646
, m_filter(pd)
4747
, m_refreshPending(false)
4848
{
49-
49+
m_filter->AddRef();
5050
}
5151

5252
PacketManager::~PacketManager()
@@ -61,6 +61,8 @@ PacketManager::~PacketManager()
6161
}
6262
m_packets.clear();
6363
m_childPackets.clear();
64+
65+
m_filter->Release();
6466
}
6567

6668
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

src/ngscopeclient/Session.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ void Session::Clear()
182182

183183
lock_guard<shared_mutex> lock(m_waveformDataMutex);
184184

185+
//Clear packet managers before removing filters (since they can hold references to them)
186+
m_packetmgrs.clear();
187+
185188
/**
186189
HACK: for now, export filters keep an open reference to themselves to avoid memory leaks
187190

0 commit comments

Comments
 (0)