Whoops.. I can has memory leak?

This commit is contained in:
Charles J. Cliffe 2015-08-11 22:11:54 -04:00
parent 655e4da1dc
commit 0c1f3149ac
3 changed files with 10 additions and 4 deletions

View File

@ -358,7 +358,6 @@ AppFrame::AppFrame() :
SetAcceleratorTable(accel);
// frame rate = 1000 / 30 = 33ms
frame_timer.Start(33);
// static const int attribs[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
// wxLogStatus("Double-buffered display %s supported", wxGLCanvas::IsDisplaySupported(attribs) ? "is" : "not");
// ShowFullScreen(true);
@ -381,6 +380,10 @@ void AppFrame::initDeviceParams(std::string deviceId) {
if (devConfig->getIQSwap()) {
iqSwapMenuItem->Check();
}
if (!frame_timer.IsRunning()) {
frame_timer.Start(33);
}
}
@ -719,7 +722,8 @@ void AppFrame::OnTimer(wxTimerEvent& event) {
} else {
fftDistrib.setFFTSize(DEFAULT_FFT_SIZE);
}
fftDistrib.setLinesPerSecond(60);
fftDistrib.setLinesPerSecond(24);
wxGetApp().getWaterfallVisualQueue()->set_max_num_items(24);
fftDistrib.run();
wproc->setView(waterfallCanvas->getViewState());

View File

@ -58,10 +58,10 @@ bool CubicSDR::OnInit() {
spectrumDistributor.setInput(pipeIQVisualData);
pipeDemodIQVisualData = new DemodulatorThreadInputQueue();
pipeIQVisualData->set_max_num_items(1);
pipeDemodIQVisualData->set_max_num_items(1);
pipeSpectrumIQVisualData = new DemodulatorThreadInputQueue();
pipeIQVisualData->set_max_num_items(1);
pipeSpectrumIQVisualData->set_max_num_items(1);
pipeWaterfallIQVisualData = new DemodulatorThreadInputQueue();
pipeWaterfallIQVisualData->set_max_num_items(512);

View File

@ -117,6 +117,7 @@ void SDRPostThread::run() {
if (iqVisualQueue != NULL && iqVisualQueue->empty()) {
DemodulatorThreadIQData *visualDataOut = visualDataBuffers.getBuffer();
visualDataOut->busy_rw.lock();
visualDataOut->setRefCount(1);
if (visualDataOut->data.size() < num_vis_samples) {
@ -130,6 +131,7 @@ void SDRPostThread::run() {
visualDataOut->sampleRate = data_in->sampleRate;
visualDataOut->data.assign(dataOut.begin(), dataOut.begin() + num_vis_samples);
visualDataOut->busy_rw.unlock();
iqVisualQueue->push(visualDataOut);
}