Skip to content

Commit

Permalink
fix dispose webview in exposed frontend function
Browse files Browse the repository at this point in the history
  • Loading branch information
yeweiasia committed Oct 25, 2022
1 parent 72c9201 commit 5d6bb43
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"codearts",
"plugin"
],
"version": "0.4.3",
"version": "0.4.4",
"license": "SEE LICENSE IN LICENSE",
"description": "core plugin api of cloudide frontend and backend",
"repository": {
Expand Down
6 changes: 4 additions & 2 deletions src/node/plugin-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,11 @@ export class Plugin {

public dispatchMessage(sourceViewType: string, message: any): void {
this.container.forEach(async (webviewContainer, viewType) => {
if (viewType !== sourceViewType) {
if (viewType !== sourceViewType && !webviewContainer.disposed) {
await webviewContainer.pageInitialized.promise;
webviewContainer.postMessage(message);
if (!webviewContainer.disposed) {
webviewContainer.postMessage(message);
}
}
});
}
Expand Down

0 comments on commit 5d6bb43

Please sign in to comment.