By default, Firefox 4 will not prompt you when you close your browser like you were in Firefox 3. It implicit assume user wants to close the browser without saving the tab.
To bring back the function, simply open a page to about:config and set browser.showQuitWarning;false to true.
I wish there is a button to enable this, but the trick above worked for me.