atom/atom — pull request #3223 by kevinsawicki (2014-08-11 20:12:42+00:00)
Title: Save state during beforeunload event

The window `unload` event is now async, see #3144 for more details, so saving needs to be done during a `beforeunload` to ensure that on window reload the new render process is using the state saved from the previous render process.

This splits unload into two steps, the serializing/saving is done in a `beforeunload` while the workspace view and project are destroyed in the `unload` handler.

Fixes #3144