Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛Fix kernel not dispose when closed #101

Merged
merged 4 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ const xircuits: JupyterFrontEndPlugin<void> = {
return outputPanel;
}

// Dispose the output panel when closing browser or tab
window.addEventListener('beforeunload', function (e) {
outputPanel.dispose();
});

async function requestToSparkSubmit(path: string, addArgs: string) {
const dataToSend = { "currentPath": path, "addArgs": addArgs };

Expand Down Expand Up @@ -281,9 +286,6 @@ const xircuits: JupyterFrontEndPlugin<void> = {
// Create the panel if it does not exist
if (!outputPanel || outputPanel.isDisposed) {
await createPanel();
} else {
outputPanel.dispose();
await createPanel();
}

outputPanel.session.ready.then(async () => {
Expand Down
7 changes: 0 additions & 7 deletions src/kernel/panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,16 @@ import {
SessionContext,
sessionContextDialogs,
} from '@jupyterlab/apputils';

import { OutputAreaModel, SimplifiedOutputArea } from '@jupyterlab/outputarea';

import { IRenderMimeRegistry } from '@jupyterlab/rendermime';

import { KernelMessage, ServiceManager } from '@jupyterlab/services';

import {
ITranslator,
nullTranslator,
TranslationBundle,
} from '@jupyterlab/translation';

import { Message } from '@lumino/messaging';

import { StackedPanel } from '@lumino/widgets';

import { Log } from '../log/LogPlugin';
import { xircuitsIcon } from '../ui-components/icons';
import { XircuitFactory } from '../xircuitFactory';
Expand Down