This commit is contained in:
blueloveTH 2022-12-31 05:35:43 +08:00
parent 1044475f70
commit 8f788807ed
5 changed files with 15 additions and 5 deletions

View File

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

View File

@ -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

View File

@ -116,6 +116,8 @@ 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)
{

View File

@ -90,6 +90,14 @@ 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)
{

View File

@ -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