mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-12-12 03:23:57 +00:00
Freqman mem reduce (#1076)
-made frequency lists a widget to avoid a full frequency_list copy -reduced FREQMAN_MAX_PER_FILE to a working limit
This commit is contained in:
@@ -36,7 +36,11 @@ void ReconView::clear_freqlist_for_ui_action() {
|
||||
freqlist_cleared_for_ui_action = true;
|
||||
// if in manual mode, there is enough memory to load freqman files, else we have to unload/reload
|
||||
if (!manual_mode) {
|
||||
frequency_list.clear();
|
||||
// clear and shrink_to_fit are not enough to really start with a new, clean, empty vector
|
||||
// swap is the only way to achieve a perfect memory liberation
|
||||
std::vector<freqman_entry>().swap(frequency_list);
|
||||
} else {
|
||||
frequency_list.shrink_to_fit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -687,7 +691,10 @@ ReconView::ReconView(NavigationView& nav)
|
||||
} else {
|
||||
audio::output::stop();
|
||||
|
||||
frequency_list.clear();
|
||||
// clear and shrink_to_fit are not enough to really start with a new, clean, empty vector
|
||||
// swap is the only way to achieve a perfect memory liberation
|
||||
std::vector<freqman_entry>().swap(frequency_list);
|
||||
|
||||
freqman_entry manual_freq_entry;
|
||||
|
||||
def_step = step_mode.selected_index(); // max range val
|
||||
@@ -895,8 +902,10 @@ void ReconView::frequency_file_load(bool stop_all_before) {
|
||||
audio::output::stop();
|
||||
|
||||
def_step = step_mode.selected_index(); // use def_step from manual selector
|
||||
frequency_list.clear(); // clear the existing frequency list (expected behavior)
|
||||
std::string file_input = input_file; // default recon mode
|
||||
// clear and shrink_to_fit are not enough to really start with a new, clean, empty vector
|
||||
// swap is the only way to achieve a perfect memory liberation
|
||||
std::vector<freqman_entry>().swap(frequency_list); // clear the existing frequency list (expected behavior)
|
||||
std::string file_input = input_file; // default recon mode
|
||||
if (scanner_mode) {
|
||||
file_input = output_file;
|
||||
file_name.set_style(&style_red);
|
||||
|
||||
Reference in New Issue
Block a user