The Still of the Night
(1982)

Sam Rice (Roy Scheider) is a psychiatrist. His patient Mr Bynum is murdered. Rice starts an affair with Bynum's mistress Brooke (Meryl Streep).  As the police hunt for the killer, clues seem to point to Brooke. The police warn Rice that he may be a target of the killer.

Rice learns that Bynum had an old girlfriend, Gail. Gail hates Brooke for taking Bynum. Gail is trying to frame Brooke for murder. Gail has killed the police detective.  Gail goes to Brooke's family home to kill her. Rice is out waiting in the car, and Gail stabs him. Gail chases Brooke through the mansion.  Gail falls from a balcony and dies. Rice's survives the stabbing, and hugs Brooke at the end.

Thanks Joseph C!