Skip to content

Commit 5c2b21f

Browse files
feat: delete currentIntegration when destroy
1 parent 3d01791 commit 5c2b21f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/ckeditor5/src/plugin.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ import chemIcon from "../theme/icons/ckeditor5-chem.svg";
2626
import packageInfo from "../package.json";
2727

2828
export let currentInstance = null; // eslint-disable-line import/no-mutable-exports
29-
export const integration = null; // eslint-disable-line import/no-mutable-exports
29+
30+
let currentIntegration = null;
3031

3132
export default class MathType extends Plugin {
3233
static get requires() {
@@ -39,19 +40,19 @@ export default class MathType extends Plugin {
3940

4041
init() {
4142
// Create the MathType API Integration object
42-
const integration = this._addIntegration();
43+
currentIntegration = this._addIntegration();
4344

4445
// Add the MathType and ChemType commands to the editor
4546
this._addCommands();
4647

4748
// Add the buttons for MathType and ChemType
48-
this._addViews(this.integration);
49+
this._addViews(currentIntegration);
4950

5051
// Registers the <mathml> element in the schema
5152
this._addSchema();
5253

5354
// Add the downcast and upcast converters
54-
this._addConverters(this.integration);
55+
this._addConverters(currentIntegration);
5556

5657
// Expose the WirisPlugin variable to the window
5758
this._exposeWiris();
@@ -61,7 +62,7 @@ export default class MathType extends Plugin {
6162
* Inherited from Plugin class: Executed when CKEditor5 is destroyed
6263
*/
6364
destroy() {
64-
this.integration.destroy();
65+
currentIntegration.destroy();
6566
}
6667

6768
/**

0 commit comments

Comments
 (0)