Jaded-Encoding-Thaumaturgy / vs-preview

Previewer for VapourSynth scripts.
Apache License 2.0
57 stars 16 forks source link

Crash when reloading and benchmark is still running #137

Closed jsaowji closed 2 months ago

jsaowji commented 3 months ago

repro: start benchmark hit reload, sometimes just warning sometimes crash

import vapoursynth as vs
core = vs.core
core.std.BlankClip(width=1920, height=1080,length=90000).set_output(0)
2024-03-26 09:12:04.156: concurrent.futures: ERROR: exception calling callback for <Future at 0x749c4aff7b90 state=finished returned VideoFrame>
Traceback (most recent call last):
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 340, in _invoke_callbacks
    callback(self)
  File "/usr/lib/python3.11/site-packages/vspreview/toolbars/benchmark/toolbar.py", line 191, in _request_next_frame_unsequenced
    self.main.current_output.source.original_clip.get_frame_async(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'source'
2024-03-26 09:12:05.005: root: ERROR: We are not running inside an environment.
2024-03-26 09:12:05.006: root: ERROR: Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/vspreview/main/window.py", line 369, in load_script
    environment=vs.get_current_environment(),
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "vapoursynth.pyx", line 522, in vapoursynth.get_current_environment
RuntimeError: We are not running inside an environment.

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/vspreview/main/dialog.py", line 57, in on_reload_clicked
    self.main.reload_script()
  File "/usr/lib/python3.11/site-packages/vspreview/main/window.py", line 668, in reload_script
    self.clean_core_references()
  File "/usr/lib/python3.11/site-packages/vspreview/main/window.py", line 656, in clean_core_references
    vs.clear_outputs()
  File "vapoursynth.pyx", line 678, in vapoursynth.clear_outputs
  File "vapoursynth.pyx", line 667, in vapoursynth._get_output_dict
vapoursynth.Error: Internal environment id not set. clear_outputs called from a filter callback?