mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Don’t recycle the same composite disposable for stylesheet activation
This commit is contained in:
@@ -50,6 +50,7 @@ class Package
|
||||
keymaps: null
|
||||
menus: null
|
||||
stylesheets: null
|
||||
stylesheetDisposables: null
|
||||
grammars: null
|
||||
scopedProperties: null
|
||||
mainModulePath: null
|
||||
@@ -62,7 +63,6 @@ class Package
|
||||
|
||||
constructor: (@path, @metadata) ->
|
||||
@emitter = new Emitter
|
||||
@stylesheetDisposables = new CompositeDisposable
|
||||
@metadata ?= Package.loadMetadata(@path)
|
||||
@bundledPackage = Package.isBundledPackagePath(@path)
|
||||
@name = @metadata?.name ? path.basename(@path)
|
||||
@@ -178,8 +178,9 @@ class Package
|
||||
|
||||
context = 'atom-text-editor' if @metadata.theme is 'syntax'
|
||||
group = @getStylesheetType()
|
||||
@stylesheetDisposables = new CompositeDisposable
|
||||
for [sourcePath, source] in @stylesheets
|
||||
@stylesheetDisposables.add(atom.styles.addStyleSheet(source, {sourcePath, sourcePath, context}))
|
||||
@stylesheetDisposables.add(atom.styles.addStyleSheet(source, {sourcePath, group, context}))
|
||||
@stylesheetsActivated = true
|
||||
|
||||
activateResources: ->
|
||||
@@ -322,7 +323,7 @@ class Package
|
||||
deactivateResources: ->
|
||||
grammar.deactivate() for grammar in @grammars
|
||||
scopedProperties.deactivate() for scopedProperties in @scopedProperties
|
||||
atom.themes.removeStylesheet(stylesheetPath) for [stylesheetPath] in @stylesheets
|
||||
@stylesheetDisposables?.dispose()
|
||||
@activationDisposables?.dispose()
|
||||
@stylesheetsActivated = false
|
||||
@grammarsActivated = false
|
||||
|
||||
Reference in New Issue
Block a user