Luckily for mankind, Will Smith is Robert Neville -- a scientist who is part of the one percent who are naturally immune to zombification -- and he's looking to cure the zombie population. He does this by kidnapping and experimenting on said zombies in his basement. But the zombies aren't cool with being experimented on, and they track him down looking for sweet zombie revenge.
Sweet zombie revenge laughs at your puny glass wall.
Neville's got two useless sidekicks with him, and as they all run into his lab to hide, they discover that he's finally found a cure and can now save the whole world. Awesome. Well, it would be if there weren't a few dozen zombies chasing them looking for the previously mentioned sweet zombie revenge. Fortunately, Neville has a fortified coal chute and some grenades in his lab. So he takes a sample of the cured zombie's blood, gives it to the lead useless female and tells her "the cure's in your blood," then locks the two sidekicks in the coal chute that we're explicitly told can easily fit all three of them. Finally, he blows himself and the zombies up with the grenade.
Because hey, if you're going to react, why not overreact?