[Fix] bug when close TapGateway
This commit is contained in:
parent
e44ad6955c
commit
7682749bba
@ -11,7 +11,7 @@ from vnpy.gateway.ctp import CtpGateway
|
||||
# from vnpy.gateway.ctptest import CtptestGateway
|
||||
from vnpy.gateway.femas import FemasGateway
|
||||
from vnpy.gateway.tiger import TigerGateway
|
||||
from vnpy.gateway.oes import OesGateway
|
||||
# from vnpy.gateway.oes import OesGateway
|
||||
from vnpy.gateway.okex import OkexGateway
|
||||
from vnpy.gateway.huobi import HuobiGateway
|
||||
from vnpy.gateway.bitfinex import BitfinexGateway
|
||||
@ -19,7 +19,7 @@ from vnpy.gateway.onetoken import OnetokenGateway
|
||||
from vnpy.gateway.okexf import OkexfGateway
|
||||
# from vnpy.gateway.xtp import XtpGateway
|
||||
from vnpy.gateway.hbdm import HbdmGateway
|
||||
# from vnpy.gateway.tap import TapGateway
|
||||
from vnpy.gateway.tap import TapGateway
|
||||
|
||||
from vnpy.app.cta_strategy import CtaStrategyApp
|
||||
from vnpy.app.csv_loader import CsvLoaderApp
|
||||
@ -45,7 +45,7 @@ def main():
|
||||
main_engine.add_gateway(FutuGateway)
|
||||
main_engine.add_gateway(BitmexGateway)
|
||||
main_engine.add_gateway(TigerGateway)
|
||||
main_engine.add_gateway(OesGateway)
|
||||
# main_engine.add_gateway(OesGateway)
|
||||
main_engine.add_gateway(OkexGateway)
|
||||
main_engine.add_gateway(HuobiGateway)
|
||||
main_engine.add_gateway(BitfinexGateway)
|
||||
@ -53,7 +53,7 @@ def main():
|
||||
main_engine.add_gateway(OkexfGateway)
|
||||
main_engine.add_gateway(HbdmGateway)
|
||||
# main_engine.add_gateway(XtpGateway)
|
||||
# main_engine.add_gateway(TapGateway)
|
||||
main_engine.add_gateway(TapGateway)
|
||||
|
||||
main_engine.add_app(CtaStrategyApp)
|
||||
main_engine.add_app(CtaBacktesterApp)
|
||||
|
@ -336,6 +336,7 @@ class QuoteApi(ITapQuoteAPINotify):
|
||||
"""
|
||||
Release TAP API resources.
|
||||
"""
|
||||
if self.api:
|
||||
self.api.SetAPINotify(None)
|
||||
FreeTapQuoteAPI(self.api)
|
||||
self.api = None
|
||||
@ -813,6 +814,7 @@ class TradeApi(ITapTradeAPINotify):
|
||||
"""
|
||||
Release TAP API resources.
|
||||
"""
|
||||
if self.api:
|
||||
self.api.SetAPINotify(None)
|
||||
FreeITapTradeAPI(self.api)
|
||||
self.api = None
|
||||
|
Loading…
Reference in New Issue
Block a user