File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/snaps-controllers/src/snaps Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1718,8 +1718,9 @@ export class SnapController extends BaseController<
17181718 throw new Error ( `The snap "${ snapId } " is not running.` ) ;
17191719 }
17201720
1721- // No-op if the Snap is already stopping.
1721+ // If we are already stopping, wait for that to finish .
17221722 if ( runtime . stopPromise ) {
1723+ await runtime . stopPromise ;
17231724 return ;
17241725 }
17251726
@@ -4090,14 +4091,14 @@ export class SnapController extends BaseController<
40904091 this . #snapsRuntimeData. set ( snapId , {
40914092 lastRequest : null ,
40924093 startPromise : null ,
4094+ stopPromise : null ,
40934095 installPromise : null ,
40944096 encryptionKey : null ,
40954097 encryptionSalt : null ,
40964098 activeReferences : 0 ,
40974099 pendingInboundRequests : [ ] ,
40984100 pendingOutboundRequests : 0 ,
40994101 interpreter,
4100- stopping : false ,
41014102 stateMutex : new Mutex ( ) ,
41024103 getStateMutex : new Mutex ( ) ,
41034104 } ) ;
You can’t perform that action at this time.
0 commit comments