blueloveTH před 3 roky
rodič
revize
8f788807ed

+ 1 - 1
plugins/flutter/CHANGELOG.md

@@ -1,4 +1,4 @@
-## 0.6.1+1
+## 0.6.1+2
 
 + Break change
 

+ 1 - 1
plugins/flutter/example/pubspec.lock

@@ -108,7 +108,7 @@ packages:
       path: ".."
       relative: true
     source: path
-    version: "0.6.1+1"
+    version: "0.6.1+2"
   sky_engine:
     dependency: transitive
     description: flutter

+ 3 - 1
plugins/flutter/lib/no_web.dart

@@ -115,7 +115,9 @@ enum ThreadState { ready, running, suspended, finished }
 
 class ThreadedVM extends VM {
   ThreadState get state => ThreadState.values[_Bindings.pkpy_tvm_get_state(pointer)];
-  
+
+
+
   /// Run a given source on a threaded virtual machine. The excution will be started in a new thread.
   void exec_async(String source)
   {

+ 9 - 1
plugins/flutter/lib/web.dart

@@ -89,7 +89,15 @@ enum ThreadState { ready, running, suspended, finished }
 
 class ThreadedVM extends VM {
   ThreadState get state => ThreadState.values[_Bindings.pkpy_tvm_get_state(pointer)];
-  
+
+
+  @override
+  void dispose() {
+    terminate();
+    Future.delayed(Duration(milliseconds: 150)).then((_) => _Bindings.pkpy_delete(pointer));
+  }
+
+
   /// Run a given source on a threaded virtual machine. The excution will be started in a new thread.
   void exec_async(String source)
   {

+ 1 - 1
plugins/flutter/pubspec.yaml

@@ -1,6 +1,6 @@
 name: pocketpy
 description: A lightweight Python interpreter for game engines.
-version: 0.6.1+1
+version: 0.6.1+2
 homepage: https://pocketpy.dev
 repository: https://github.com/blueloveth/pocketpy