Fix crash when session is reset from macro
- closes #18261 (closed)
- related issue https://discourse.paraview.org/t/reset-session-programatically-in-python-macro/9218
- The action map iterator will be invalidated if a macro resets the session. Further references to this iterator is an access violation and causes a crash.
- Change the code to grab filenames prior to executing the macro scripts.