[Add] api.ctp: terminate task queue when exit() is called
This commit is contained in:
parent
262eb2498f
commit
66edd75a2b
@ -570,7 +570,8 @@ int MdApi::join()
|
|||||||
int MdApi::exit()
|
int MdApi::exit()
|
||||||
{
|
{
|
||||||
this->active = false;
|
this->active = false;
|
||||||
//this->task_thread.join();
|
this->task_queue.terminate();
|
||||||
|
this->task_thread.join();
|
||||||
|
|
||||||
this->api->RegisterSpi(NULL);
|
this->api->RegisterSpi(NULL);
|
||||||
this->api->Release();
|
this->api->Release();
|
||||||
@ -808,8 +809,6 @@ public:
|
|||||||
|
|
||||||
PYBIND11_MODULE(vnctpmd, m)
|
PYBIND11_MODULE(vnctpmd, m)
|
||||||
{
|
{
|
||||||
PyEval_InitThreads(); //导入时运行,保证先创建GIL
|
|
||||||
|
|
||||||
class_<MdApi, PyMdApi> mdapi(m, "MdApi");
|
class_<MdApi, PyMdApi> mdapi(m, "MdApi");
|
||||||
mdapi
|
mdapi
|
||||||
.def(init<>())
|
.def(init<>())
|
||||||
|
@ -7921,7 +7921,8 @@ int TdApi::join()
|
|||||||
int TdApi::exit()
|
int TdApi::exit()
|
||||||
{
|
{
|
||||||
this->active = false;
|
this->active = false;
|
||||||
//this->task_thread.join();
|
this->task_queue.terminate();
|
||||||
|
this->task_thread.join();
|
||||||
|
|
||||||
this->api->RegisterSpi(NULL);
|
this->api->RegisterSpi(NULL);
|
||||||
this->api->Release();
|
this->api->Release();
|
||||||
@ -10631,8 +10632,6 @@ public:
|
|||||||
|
|
||||||
PYBIND11_MODULE(vnctptd, m)
|
PYBIND11_MODULE(vnctptd, m)
|
||||||
{
|
{
|
||||||
PyEval_InitThreads(); //导入时运行,保证先创建GIL
|
|
||||||
|
|
||||||
class_<TdApi, PyTdApi> TdApi(m, "TdApi");
|
class_<TdApi, PyTdApi> TdApi(m, "TdApi");
|
||||||
TdApi
|
TdApi
|
||||||
.def(init<>())
|
.def(init<>())
|
||||||
|
Loading…
Reference in New Issue
Block a user