File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -956,7 +956,7 @@ class WorkerMessageHandler {
956956 return pdfManager . cleanup ( /* manuallyTriggered = */ true ) ;
957957 } ) ;
958958
959- handler . on ( "Terminate" , function ( data ) {
959+ handler . on ( "Terminate" , async function ( data ) {
960960 terminated = true ;
961961
962962 const waitOn = [ ] ;
@@ -977,12 +977,11 @@ class WorkerMessageHandler {
977977 task . terminate ( ) ;
978978 }
979979
980- return Promise . all ( waitOn ) . then ( function ( ) {
981- // Notice that even if we destroying handler, resolved response promise
982- // must be sent back.
983- handler . destroy ( ) ;
984- handler = null ;
985- } ) ;
980+ await Promise . all ( waitOn ) ;
981+ // Notice that even if we destroying handler, resolved response promise
982+ // must be sent back.
983+ handler . destroy ( ) ;
984+ handler = null ;
986985 } ) ;
987986
988987 handler . on ( "Ready" , function ( data ) {
You can’t perform that action at this time.
0 commit comments