Hi Matthias,
You should create a variable for the link, and then you can remove the link. See the code below:
Code:
hmd = oculus.Rift()
sensor = hmd.getSensor()
#To link
viewLink = viz.link(hmd.getSensor(), viz.MainView)
#To unlink:
viewLink.remove()
You should use the unlink code on the appropriate times in your code.
Good luck!
Frank