mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-07 08:24:47 -04:00
Make ReBuffer refcount management automatic, using std::shared_ptr:
- No longer need to call setRefCount() / decRefCount() - Restore old ThreadBlockingQueue using std::deque, for std::shared_ptr correct behaviour.
This commit is contained in:
@@ -104,7 +104,7 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
wxPaintDC dc(this);
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
|
||||
ScopeRenderData *avData;
|
||||
ScopeRenderDataPtr avData;
|
||||
while (inputData.try_pop(avData)) {
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
if (avData->waveform_points.size()) {
|
||||
scopePanel.setPoints(avData->waveform_points);
|
||||
}
|
||||
avData->decRefCount();
|
||||
|
||||
} else {
|
||||
if (avData->waveform_points.size()) {
|
||||
spectrumPanel.setPoints(avData->waveform_points);
|
||||
@@ -124,8 +124,7 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
spectrumPanel.setFFTSize(avData->fft_size);
|
||||
spectrumPanel.setShowDb(showDb);
|
||||
}
|
||||
|
||||
avData->decRefCount();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ void SpectrumCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
wxPaintDC dc(this);
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
|
||||
SpectrumVisualData *vData;
|
||||
SpectrumVisualDataPtr vData;
|
||||
if (visualDataQueue.try_pop(vData)) {
|
||||
|
||||
if (vData) {
|
||||
@@ -62,7 +62,6 @@ void SpectrumCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
spectrumPanel.setPeakPoints(vData->spectrum_hold_points);
|
||||
spectrumPanel.setFloorValue(vData->fft_floor);
|
||||
spectrumPanel.setCeilValue(vData->fft_ceiling);
|
||||
vData->decRefCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ void WaterfallCanvas::processInputQueue() {
|
||||
if (linesPerSecond) {
|
||||
if (lpsIndex >= targetVis) {
|
||||
while (lpsIndex >= targetVis) {
|
||||
SpectrumVisualData *vData;
|
||||
SpectrumVisualDataPtr vData;
|
||||
|
||||
if (visualDataQueue.try_pop(vData)) {
|
||||
|
||||
@@ -106,7 +106,7 @@ void WaterfallCanvas::processInputQueue() {
|
||||
waterfallPanel.setPoints(vData->spectrum_points);
|
||||
}
|
||||
waterfallPanel.step();
|
||||
vData->decRefCount();
|
||||
|
||||
updated = true;
|
||||
}
|
||||
lpsIndex-=targetVis;
|
||||
@@ -915,13 +915,7 @@ void WaterfallCanvas::setLinesPerSecond(int lps) {
|
||||
linesPerSecond = lps;
|
||||
|
||||
//empty all
|
||||
SpectrumVisualData *vData;
|
||||
while (visualDataQueue.try_pop(vData)) {
|
||||
|
||||
if (vData) {
|
||||
vData->decRefCount();
|
||||
}
|
||||
}
|
||||
visualDataQueue.flush();
|
||||
}
|
||||
|
||||
void WaterfallCanvas::setMinBandwidth(int min) {
|
||||
|
||||
Reference in New Issue
Block a user