File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,6 +274,12 @@ export class Engine {
274274 CaveatSpecificationConstraint
275275 > ;
276276
277+ /**
278+ * Shared token list service. Stored so destroyEngineInstance can call
279+ * destroy() to abort in-flight requests and clear the TanStack Query cache.
280+ */
281+ private tokenListService : TokenListService ;
282+
277283 /**
278284 * Creates a CoreController instance
279285 */
@@ -289,6 +295,7 @@ export class Engine {
289295
290296 const codefiTokenApiV2 = new CodefiTokenPricesServiceV2 ( ) ;
291297 const tokenListService = new TokenListService ( ) ;
298+ this . tokenListService = tokenListService ;
292299
293300 const initRequest = {
294301 getState : ( ) => store . getState ( ) ,
@@ -1219,6 +1226,7 @@ export class Engine {
12191226 controller . destroy ( ) ;
12201227 }
12211228 } ) ;
1229+ this . tokenListService . destroy ( ) ;
12221230 this . removeAllListeners ( ) ;
12231231 await this . resetState ( ) ;
12241232
You can’t perform that action at this time.
0 commit comments