From 925be49b2d7b98734216676d14be023f57e7e6d2 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 10 Mar 2020 23:31:20 +0100 Subject: [PATCH] Remove redundant collectgarbage() calls from scripts Since 8112d6472eca garbage is automatically collected after running a Lua GUI script. --- share/scripts/_dialog_test.lua | 4 ---- share/scripts/_dump_latency.lua | 1 - share/scripts/_remember_file.lua | 3 --- share/scripts/_rgh_midi_track_trick.lua | 1 - share/scripts/_rubberband_swing.lua | 4 ---- share/scripts/_sort_tracks_by_name.lua | 4 ---- share/scripts/_toggle_monitor_section.lua | 1 - share/scripts/_tx_raw_midi_from_file.lua | 2 -- share/scripts/_vamp_note_example.lua | 4 ---- share/scripts/_vca_slave_assign.lua | 6 +----- share/scripts/lfo_automation.lua | 3 --- share/scripts/list_plugins.lua | 5 ----- share/scripts/midi_cc_to_automation.lua | 3 --- share/scripts/mixer_screenshot.lua | 1 - share/scripts/new_playlist.lua | 2 -- share/scripts/reset_mixer.lua | 3 +-- share/scripts/store_recall_mixer.lua | 1 - share/scripts/track_organizer.lua | 1 - share/scripts/vamp_audio_to_midi.lua | 3 --- 19 files changed, 2 insertions(+), 50 deletions(-) diff --git a/share/scripts/_dialog_test.lua b/share/scripts/_dialog_test.lua index cc02f82a46..6b7e8e87d8 100644 --- a/share/scripts/_dialog_test.lua +++ b/share/scripts/_dialog_test.lua @@ -88,8 +88,4 @@ function factory () return function () if (rv) then print (serialize ("dialog", rv)) end - - od = nil - collectgarbage () - end end diff --git a/share/scripts/_dump_latency.lua b/share/scripts/_dump_latency.lua index 9303e29508..95f47dd8c8 100644 --- a/share/scripts/_dump_latency.lua +++ b/share/scripts/_dump_latency.lua @@ -73,5 +73,4 @@ function factory () return function () lc[1].min, lc[1].max, pcl.min, pcl.max, bcl.min, bcl.max)) end end - collectgarbage () end end diff --git a/share/scripts/_remember_file.lua b/share/scripts/_remember_file.lua index 7a79fc861b..13de71e3de 100644 --- a/share/scripts/_remember_file.lua +++ b/share/scripts/_remember_file.lua @@ -30,8 +30,5 @@ function factory () -- unset most recently used filename on dialog "cancel" file_name_testscript_last_filename = nil end - - od = nil - collectgarbage () end end diff --git a/share/scripts/_rgh_midi_track_trick.lua b/share/scripts/_rgh_midi_track_trick.lua index 85308be0b1..06ffbb7254 100644 --- a/share/scripts/_rgh_midi_track_trick.lua +++ b/share/scripts/_rgh_midi_track_trick.lua @@ -77,5 +77,4 @@ function factory (p) return function () end i = i + 1 end - collectgarbage () -- drop references to tracks. end end diff --git a/share/scripts/_rubberband_swing.lua b/share/scripts/_rubberband_swing.lua index f9c703284d..52ce2c1bcc 100644 --- a/share/scripts/_rubberband_swing.lua +++ b/share/scripts/_rubberband_swing.lua @@ -158,10 +158,6 @@ function factory () return function () else Session:abort_reversible_command () end - - -- clean up, unload vamp plugin - vamp = nil - collectgarbage () end end diff --git a/share/scripts/_sort_tracks_by_name.lua b/share/scripts/_sort_tracks_by_name.lua index 36dfdc970c..39e0a458b1 100644 --- a/share/scripts/_sort_tracks_by_name.lua +++ b/share/scripts/_sort_tracks_by_name.lua @@ -29,8 +29,4 @@ function factory () return function () t:set_presentation_order(pos) pos = pos + 1 end - - -- drop all track references - tracklist = nil - collectgarbage () end end diff --git a/share/scripts/_toggle_monitor_section.lua b/share/scripts/_toggle_monitor_section.lua index e097a94a32..0853ef2fb4 100644 --- a/share/scripts/_toggle_monitor_section.lua +++ b/share/scripts/_toggle_monitor_section.lua @@ -5,6 +5,5 @@ function factory () return function () ARDOUR.config():set_use_monitor_bus (true) else ARDOUR.config():set_use_monitor_bus (false) - collectgarbage () end end end diff --git a/share/scripts/_tx_raw_midi_from_file.lua b/share/scripts/_tx_raw_midi_from_file.lua index ac45cd1b10..d75f3cca49 100644 --- a/share/scripts/_tx_raw_midi_from_file.lua +++ b/share/scripts/_tx_raw_midi_from_file.lua @@ -105,8 +105,6 @@ function factory () return function () end ::out:: - rv = nil - collectgarbage () end end function icon (params) return function (ctx, width, height, fg) diff --git a/share/scripts/_vamp_note_example.lua b/share/scripts/_vamp_note_example.lua index 6a93dd8ee4..9895687346 100644 --- a/share/scripts/_vamp_note_example.lua +++ b/share/scripts/_vamp_note_example.lua @@ -61,8 +61,4 @@ function factory () return function () ::out:: -- hide modal progress dialog and destroy it pdialog:done (); - pdialog = nil - vamp = nil; - collectgarbage () - end end diff --git a/share/scripts/_vca_slave_assign.lua b/share/scripts/_vca_slave_assign.lua index 616c0abd98..87eb860f21 100644 --- a/share/scripts/_vca_slave_assign.lua +++ b/share/scripts/_vca_slave_assign.lua @@ -65,9 +65,5 @@ function factory () return function () else LuaDialog.Message ("VCA Slave Example", "Recursive VCA assignment ignored", LuaDialog.MessageType.Info, LuaDialog.ButtonType.Close):run () end - - -- drop references - mst = nil slv = nil - collectgarbage () -end end +:nd end diff --git a/share/scripts/lfo_automation.lua b/share/scripts/lfo_automation.lua index a69df1af1d..3f9fa0263e 100644 --- a/share/scripts/lfo_automation.lua +++ b/share/scripts/lfo_automation.lua @@ -65,7 +65,6 @@ function factory (unused_params) LuaDialog.Message("Add LFO automation to region", "No plugin parameters found.", LuaDialog.MessageType.Info, LuaDialog.ButtonType.Close):run() region, track, targets = nil, nil, nil - collectgarbage() return end @@ -85,7 +84,6 @@ function factory (unused_params) -- Return if the user cancelled if not rv then region, track, targets = nil, nil, nil - collectgarbage() return end @@ -171,7 +169,6 @@ function factory (unused_params) Session:commit_reversible_command(nil) region, al, lut = nil, nil, nil - collectgarbage() end end diff --git a/share/scripts/list_plugins.lua b/share/scripts/list_plugins.lua index 6a6efe12b8..05514925a4 100644 --- a/share/scripts/list_plugins.lua +++ b/share/scripts/list_plugins.lua @@ -42,9 +42,4 @@ function factory () return function () end LuaDialog.Message ("All Plugins", "" .. rv .. "", LuaDialog.MessageType.Info, LuaDialog.ButtonType.Close):run() - - all_plugs = nil - rv = "" - collectgarbage (); - end end diff --git a/share/scripts/midi_cc_to_automation.lua b/share/scripts/midi_cc_to_automation.lua index a1bab91a05..c8d2946e3b 100644 --- a/share/scripts/midi_cc_to_automation.lua +++ b/share/scripts/midi_cc_to_automation.lua @@ -44,8 +44,6 @@ function factory () return function () -- bail out if there are no parameters if not have_entries then LuaDialog.Message ("CC to Plugin Automation", "No Plugins found", LuaDialog.MessageType.Info, LuaDialog.ButtonType.Close):run () - targets = nil - collectgarbage () return end @@ -117,7 +115,6 @@ function factory () return function () Session:abort_reversible_command () LuaDialog.Message ("CC to Plugin Automation", "No data was converted. Was a MIDI-region with CC-automation selected? ", LuaDialog.MessageType.Info, LuaDialog.ButtonType.Close):run () end - collectgarbage () end end function icon (params) return function (ctx, width, height, fg) diff --git a/share/scripts/mixer_screenshot.lua b/share/scripts/mixer_screenshot.lua index f8e8ded2db..06f7b2907c 100644 --- a/share/scripts/mixer_screenshot.lua +++ b/share/scripts/mixer_screenshot.lua @@ -20,7 +20,6 @@ function factory () return function () end ArdourUI.mixer_screenshot (rv['file']) end - collectgarbage () end end function icon (params) return function (ctx, width, height, fg) diff --git a/share/scripts/new_playlist.lua b/share/scripts/new_playlist.lua index 54563cd6a5..7d86c5ba7c 100644 --- a/share/scripts/new_playlist.lua +++ b/share/scripts/new_playlist.lua @@ -12,6 +12,4 @@ function factory () return function () local rtav = Editor:rtav_from_route(r) -- lookup RTAV Editor:new_playlists(rtav:to_timeaxisview()) end - -collectgarbage() end end diff --git a/share/scripts/reset_mixer.lua b/share/scripts/reset_mixer.lua index faf7aad477..00ac7cb294 100644 --- a/share/scripts/reset_mixer.lua +++ b/share/scripts/reset_mixer.lua @@ -245,5 +245,4 @@ function factory() return function() end end ::pass_script:: - collectgarbage() -end end \ No newline at end of file +end end diff --git a/share/scripts/store_recall_mixer.lua b/share/scripts/store_recall_mixer.lua index 53562b7ee2..e58fd40831 100644 --- a/share/scripts/store_recall_mixer.lua +++ b/share/scripts/store_recall_mixer.lua @@ -571,5 +571,4 @@ function factory() return function() end end end -collectgarbage() end end diff --git a/share/scripts/track_organizer.lua b/share/scripts/track_organizer.lua index 15caf2c9ff..6a270ff5b6 100644 --- a/share/scripts/track_organizer.lua +++ b/share/scripts/track_organizer.lua @@ -96,5 +96,4 @@ function factory () return function () end end ::script_end:: - collectgarbage() end end diff --git a/share/scripts/vamp_audio_to_midi.lua b/share/scripts/vamp_audio_to_midi.lua index 2f9101196c..ece305dfe2 100644 --- a/share/scripts/vamp_audio_to_midi.lua +++ b/share/scripts/vamp_audio_to_midi.lua @@ -97,9 +97,6 @@ function factory () return function () ::out:: pdialog:done (); - pdialog = nil - vamp = nil; - collectgarbage () end end function icon (params) return function (ctx, width, height, fg)