diff --git a/internal/maa/framework.go b/internal/maa/framework.go index 9c52f2b..18ba98b 100644 --- a/internal/maa/framework.go +++ b/internal/maa/framework.go @@ -25,7 +25,7 @@ var ( MaaTaskerStatus func(tasker uintptr, id int64) int32 MaaTaskerWait func(tasker uintptr, id int64) int32 MaaTaskerRunning func(tasker uintptr) bool - MaaTaskerPostStop func(tasker uintptr) bool + MaaTaskerPostStop func(tasker uintptr) int64 MaaTaskerGetResource func(tasker uintptr) uintptr MaaTaskerGetController func(tasker uintptr) uintptr MaaTaskerClearCache func(tasker uintptr) bool diff --git a/tasker.go b/tasker.go index 968d68a..5218d68 100644 --- a/tasker.go +++ b/tasker.go @@ -108,8 +108,9 @@ func (t *Tasker) Running() bool { } // PostStop posts a stop signal to the tasker. -func (t *Tasker) PostStop() bool { - return maa.MaaTaskerPostStop(t.handle) +func (t *Tasker) PostStop() *TaskJob { + id := maa.MaaTaskerPostStop(t.handle) + return NewTaskJob(id, t.status, t.wait, t.getTaskDetail) } // GetResource returns the resource handle of the tasker. diff --git a/tasker_test.go b/tasker_test.go index 16b08c4..9051a17 100644 --- a/tasker_test.go +++ b/tasker_test.go @@ -118,7 +118,7 @@ func TestTasker_PostStop(t *testing.T) { taskerBind(t, tasker, ctrl, res) got := tasker.PostStop() - require.True(t, got) + require.NotNil(t, got) } func TestTasker_GetResource(t *testing.T) {