File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 4242 - name : Upload Artifacts
4343 uses : actions/upload-artifact@v3
4444 with :
45- path : build/
45+ name : build
46+ path : |
47+ build/*.dll
48+ build/*.dylib
49+ build/*.so
4650
4751# - name: Release Plugin
4852# uses: softprops/action-gh-release@master
Original file line number Diff line number Diff line change 11import { CachePolicy , download , join , prepare } from "../deps.ts" ;
2+ import { Webview } from "./webview.ts" ;
23
34const version = "0.7.2" ;
45const policy = Deno . env . get ( "PLUGIN_URL" ) === undefined
@@ -22,6 +23,12 @@ async function checkForWebView2Loader(): Promise<boolean> {
2223// make sure we don't preload twice
2324let preloaded = false ;
2425
26+ /**
27+ * All active webview instances. This is internally used for automatically
28+ * destroying all instances once {@link unload} is called.
29+ */
30+ export const instances : Webview [ ] = [ ] ;
31+
2532/**
2633 * Loads the `./WebView2Loader.dll` for running on Windows. Removes old version
2734 * if it already existed, and only runs once. Should be run on the main thread
@@ -55,6 +62,9 @@ export async function preload() {
5562 * otherwise, you may have to call this manually.
5663 */
5764export function unload ( ) {
65+ for ( const instance of instances ) {
66+ instance . destroy ( ) ;
67+ }
5868 lib . close ( ) ;
5969 if ( Deno . build . os === "windows" ) {
6070 Deno . removeSync ( "./WebView2Loader.dll" ) ;
Original file line number Diff line number Diff line change 1- import sys from "./ffi.ts" ;
1+ import sys , { instances } from "./ffi.ts" ;
22
33const encoder = new TextEncoder ( ) ;
44const encode = ( value : string ) => encoder . encode ( value + "\0" ) ;
@@ -174,6 +174,9 @@ export class Webview {
174174 if ( size !== undefined ) {
175175 this . size = size ;
176176 }
177+
178+ // Push this instance to the global instances list to automatically destroy
179+ instances . push ( this ) ;
177180 }
178181
179182 /**
You can’t perform that action at this time.
0 commit comments