In some game systems, PCs get death saves. This is a single die roll to decide, in a situation where any sensible human being would most definitely be dead, if that death in fact happens, or if somehow miraculously the victim survives.
Death saves can add incredible moments of tension to a game. The hero should by all rights be dead, but there's this one tiny chance that they could escape their fate. A player will cradle their die reverently, perhaps blow on it for luck, and roll it across the table.
In the next second, Fate decides.
Time slows down.
All eyes around the table are on that die as it bounces, rattles, spins across the table...
... and then it falls off the edge, rolls across the floor, and under the sofa, and everyone jumps up and yells, "Where did it go?! What does it say?!"
Commentary by memnarch (who has not seen the movie)
I guess that's one way to write a character out of the movie. It would be difficult to continue working around an actor's own death even with pre-recorded scenes. And while it'd be nice if Leia lived, it'd be rather awkward to change the writing so that happens but she never shows up again. Like she goes off with part of the Resistance and does her own thing off-screen and never gets mentioned again? Then there'd just be questions like "why isn't she helping out here?" And replacing the actor can sometimes work, but it feels weird when it's more than just the voice.
I'll agree with Jim that it doesn't feel fair as well. The Resistance has been basically fighting since the start of the movie, and while there was the very big Fulminatrix that blew up, the First Order essentially shrugged and pulled out an even bigger ship. I guess that Leia dying might be the main point though, and this is the best way to do that? I know Disney declared a bunch of material non-canon so they could do their own stories. Another step they could be taking is getting rid of old main characters as well.
Hmmm, I suppose this means I should be expecting the next death to occur with the Luke-and-Rey side of the story then if we've still got that in the next movie. Luke might be extremely reluctant to be a mentor, but he still looks like one at the moment. The old mentor dying is a known trope for a reason; Star Wars even has the most famous example!
Transcript
GM: <roll>... The explosion rips the air out of the bridge. Annie, save.
Leia: 10.
[SFX]: Whooosshh!
GM: ... Really not good enough. Leia is sucked into the vacuum of space.
BB-8: Whoa...
Kylo Ren: Told you I’d be pulling no punches.
Edgar: Wow, awesome death! That’s real roleplaying! Although...
Edgar: Leia dying isn’t really fair.
Finn: It’s okay. She’ll live on in our hearts.
Edgar: No, I mean everyone gets a heroic death except me.
Rey: Poe died. And then Allan. Like two minutes ago.
Edgar: Well, yeah, but... that’s... different.
Rey: Oh?? Why might that be?
Edgar: She wasn’t even trying to die!