Los Angeles - A movie set in France about a terrorist plot on Bastille Day had to be pulled from cinemas in the country after the Nice lorry attack - it is a situation that film studios and TV networks have become accustomed to as release schedules are affected by horrific real-life events.

Producing a film or TV series is a long and laborious process - the whole operation can often take years, during which time the project can be thrown into uncertainty as a result of reality suddenly rendering the project distasteful.

Bastille Day, which stars Idris Elba in a story about civilians killed by a bomb going off in Paris, was pulled from cinemas in France the day after it was released because of what happened in Nice.

StudioCanal stopped adverts for the film immediately after the attack and soon cancelled it altogether, commenting that it was "not in line with the national mood". "Studios, like many major corporations, are risk averse," says Andreas Wiseman, head of news at Screen Daily.

"The performance over its opening weekend can often make or break a film, so distributors spend a long time strategising over an optimum release date. "If there is a chance a social or political context might turn media or audiences against a film, studios will reroute."

The studio's request to pull Bastille Day out of French cinemas was supported by the film's lead actor - Elba told The Sun that the producers probably thought the film was "insensitive" and did not "feel right to have out there".

Many French film fans, though, were disappointed with the studio's decision - one told Reuters he "didn't make the connection with Nice". "There are so many differences. I think it's a coincidence and I find it a shame for the people who made the film."

In America, TV series Shooter - a drama about a sniper - was postponed after unrest prompted by the shooting of black men by police.

USA Network initially delayed the show's debut by a week - "after further consideration", it was subsequently postponed until the autumn.

Paris-based film journalist Lisa Nesselson, who saw Bastille Day in a French cinema after the Nice attack, says she is unsure whether TV networks and film studios should react in the same way.

"I don't know if films are delayed or pulled out of respect for terror victims, because it's assumed that nobody will be in the mood to see that topic or a little of both," she says.

"I might be in favour of changing television programming in deference to a violent national event, but I find it much harder to grasp why a movie that requires an individual to make the decision to pay to get in should be punished for being about the 'wrong' thing at a particular moment in time."

Perhaps the biggest single event of recent times to affect the film and TV industry was the 9/11 attack in 2001.

A scene in Spider-Man featuring the twin towers of New York's World Trade Center was deleted from the film and the trailers in light of the sombre national mood and the location was also edited out of Men In Black II and Zoolander.

On television, Friends - one of the most successful sitcoms of all time - cut an entire storyline from one episode which saw Chandler detained at an airport after making a joke about a bomb.

It was swiftly replaced by a new storyline involving Monica and Chandler and the already-filmed footage was only released years later as part of a box set.

In the UK, one of the longest delays to a major film came in 2007, when Gone Baby Gone was due to be released.

It came out in the US in October and was set for a UK release in December - but was halted by the disappearance of Madeleine McCann as the producers felt the plot, which dealt with a young girl going missing, was distasteful.