From 6e20f1168048fdc915a54f12b64be96e2afcfa8a Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Wed, 8 Jul 2015 19:25:22 -0400 Subject: [PATCH] Deprecate offset setting in session to avoid device conflict Possible fix for session loading memory leak; may sometimes buffer IQ data to demodulators loaded outside of the current center and bandwidth that should be inactive. --- src/AppFrame.cpp | 6 +----- src/CubicSDR.cpp | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index 64365d1..f2eba43 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -645,7 +645,6 @@ void AppFrame::saveSession(std::string fileName) { DataNode *header = s.rootNode()->newChild("header"); *header->newChild("version") = std::string(CUBICSDR_VERSION); *header->newChild("center_freq") = wxGetApp().getFrequency(); - *header->newChild("offset") = wxGetApp().getOffset(); DataNode *demods = s.rootNode()->newChild("demodulators"); @@ -684,14 +683,11 @@ bool AppFrame::loadSession(std::string fileName) { std::string version(*header->getNext("version")); long long center_freq = *header->getNext("center_freq"); - long long offset = *header->getNext("offset"); std::cout << "Loading " << version << " session file" << std::endl; std::cout << "\tCenter Frequency: " << center_freq << std::endl; - std::cout << "\tOffset: " << offset << std::endl; wxGetApp().setFrequency(center_freq); - wxGetApp().setOffset(offset); DataNode *demodulators = l.rootNode()->getNext("demodulators"); @@ -739,7 +735,7 @@ bool AppFrame::loadSession(std::string fileName) { } newDemod->run(); - + newDemod->setActive(false); wxGetApp().bindDemodulator(newDemod); std::cout << "\tAdded demodulator at frequency " << freq << " type " << type << std::endl; diff --git a/src/CubicSDR.cpp b/src/CubicSDR.cpp index 659e3e5..64cf57a 100644 --- a/src/CubicSDR.cpp +++ b/src/CubicSDR.cpp @@ -79,9 +79,6 @@ bool CubicSDR::OnInit() { devName.append(" ["); devName.append((*devs_i)->getSerial()); devName.append("]"); - if (!dev) { - dev = (*devs_i); - } } else { devName.append(" (In Use?)"); }