Paraview crashes after closing python gui

I am running a python script with the superbuild python, this script opens a tkinter gui. After closing the window, paraview crashes. I have tried running the vtkPythonInterpreter ‘runSimpleString’ function normally and in a seperate thread using qtConcurrent, both produce the same result. Any suggestions?

I am using superbuild v5.9.1 on windows, with a custom version of python. I have found that executing any python script will crash paraview after the script is completed.