diff --git a/plugins/flutter/CHANGELOG.md b/plugins/flutter/CHANGELOG.md index db502947..903cf042 100644 --- a/plugins/flutter/CHANGELOG.md +++ b/plugins/flutter/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.6.1+1 +## 0.6.1+2 + Break change diff --git a/plugins/flutter/example/pubspec.lock b/plugins/flutter/example/pubspec.lock index 8dd1df6b..80c7aefc 100644 --- a/plugins/flutter/example/pubspec.lock +++ b/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 diff --git a/plugins/flutter/lib/no_web.dart b/plugins/flutter/lib/no_web.dart index ac2dedde..13caf931 100644 --- a/plugins/flutter/lib/no_web.dart +++ b/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) { diff --git a/plugins/flutter/lib/web.dart b/plugins/flutter/lib/web.dart index ddb94807..ebc13108 100644 --- a/plugins/flutter/lib/web.dart +++ b/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) { diff --git a/plugins/flutter/pubspec.yaml b/plugins/flutter/pubspec.yaml index 73390323..c35b8a27 100644 --- a/plugins/flutter/pubspec.yaml +++ b/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