Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

Commit

Permalink
🐛 Ensure we always bootstrap properly
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjo committed May 7, 2015
1 parent 596c111 commit c3803d6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ export default {
deactivate() {
if (this.commands) {
this.commands.dispose();
delete this.commands;
}

if (this.composer) {
this.composer.destroy();
this.composer = null;
delete this.composer;
}

if (global.latex) {
delete global.latex;
}
},

Expand All @@ -39,13 +44,12 @@ export default {
},

bootstrap() {
if (this.bootstrapped) { return; }
if (this.composer && global.latex) { return; }

const Latex = require("./latex");
const Composer = require("./composer");

global.latex = new Latex();
this.composer = new Composer();
this.bootstrapped = true;
},
};

0 comments on commit c3803d6

Please sign in to comment.