mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Save BlobStore only in the first window
This commit is contained in:
@@ -212,6 +212,7 @@ class AtomApplication
|
||||
@openPathOnEvent('application:open-license', path.join(process.resourcesPath, 'LICENSE.md'))
|
||||
|
||||
app.on 'before-quit', =>
|
||||
@saveBlobStore()
|
||||
@saveState(false)
|
||||
@quitting = true
|
||||
|
||||
@@ -433,6 +434,9 @@ class AtomApplication
|
||||
console.log("Killing process #{pid} failed: #{error.code ? error.message}")
|
||||
delete @pidsToOpenWindows[pid]
|
||||
|
||||
saveBlobStore: ->
|
||||
@windows[0]?.saveBlobStore()
|
||||
|
||||
saveState: (allowEmpty=false) ->
|
||||
return if @quitting
|
||||
states = []
|
||||
|
||||
@@ -75,6 +75,9 @@ class AtomWindow
|
||||
hasPathToOpen = not (locationsToOpen.length is 1 and not locationsToOpen[0].pathToOpen?)
|
||||
@openLocations(locationsToOpen) if hasPathToOpen and not @isSpecWindow()
|
||||
|
||||
saveBlobStore: ->
|
||||
@browserWindow.webContents?.send('save-blob-store')
|
||||
|
||||
setLoadSettings: (loadSettingsObj) ->
|
||||
# Ignore the windowState when passing loadSettings via URL, since it could
|
||||
# be quite large.
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
(function () {
|
||||
var app = require('remote').require('app')
|
||||
var fs = require('fs-plus')
|
||||
var path = require('path')
|
||||
var FileSystemBlobStore = require('../src/file-system-blob-store')
|
||||
var NativeCompileCache = require('../src/native-compile-cache')
|
||||
var ipc = require('ipc')
|
||||
|
||||
var loadSettings = null
|
||||
var loadSettingsError = null
|
||||
var blobStore = null
|
||||
|
||||
app.on('before-quit', function () {
|
||||
ipc.on('save-blob-store', function () {
|
||||
if (blobStore) {
|
||||
blobStore.save()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user