               unless tvState.hasFocus
                 atom.workspace.getActivePane().activate()
         else
-          # Close all buffers
-          buffer?.destroy() for buffer in atom.project.buffers
-
           # Set project paths
           atom.project.setPaths(item.paths)
+
+          # Close all buffers
+          closeAllBuffers()
 
         # HACK[Pigments]: Pigments needs to reload on project reload
         pigments = atom.packages.getActivePackage("pigments")


    # Save the state of the current project
    saveCurrentState().then () ->

      # HACK: Tab bar doesn't unsubscribe; memory leak
      tabs = atom.packages.getActivePackage("tabs")
      if tabs
        tabBarView.unsubscribe() for tabBarView in tabs.mainModule.tabBarViews

      # Load the state of the new project
      loadState(newKey).then (state) ->

exports.closeProject = () ->
  # Save the state of the current project
  saveCurrentState().then () ->
    # Set project paths
    atom.project.setPaths([])

    # Close all buffers
    closeAllBuffers()

    # TODO: Should we close the tree-view?
    treeViewPack = atom.packages.getActivePackage("tree-view")
