langtools/src/jdk.jshell/share/classes/jdk/jshell/JShell.java
changeset 43757 7193f6ef25db
parent 42969 a48d4f74d322
child 43758 868af3718a21
equal deleted inserted replaced
43756:118221d3960d 43757:7193f6ef25db
   541      * Close this state engine. Frees resources. Should be called when this
   541      * Close this state engine. Frees resources. Should be called when this
   542      * state engine is no longer needed.
   542      * state engine is no longer needed.
   543      */
   543      */
   544     @Override
   544     @Override
   545     public void close() {
   545     public void close() {
   546         if (!closed) {
   546         closeDown();
   547             closeDown();
       
   548             try {
       
   549                 executionControl().close();
       
   550             } catch (Throwable ex) {
       
   551                 // don't care about exceptions on close
       
   552             }
       
   553             if (sourceCodeAnalysis != null) {
       
   554                 sourceCodeAnalysis.close();
       
   555             }
       
   556         }
       
   557     }
   547     }
   558 
   548 
   559     /**
   549     /**
   560      * Return all snippets.
   550      * Return all snippets.
   561      * @return the snippets for all current snippets in id order.
   551      * @return the snippets for all current snippets in id order.
   824             try {
   814             try {
   825                 notifyShutdownEvent(this);
   815                 notifyShutdownEvent(this);
   826             } catch (Throwable thr) {
   816             } catch (Throwable thr) {
   827                 // Don't care about dying exceptions
   817                 // Don't care about dying exceptions
   828             }
   818             }
       
   819             try {
       
   820                 executionControl().close();
       
   821             } catch (Throwable ex) {
       
   822                 // don't care about exceptions on close
       
   823             }
       
   824             if (sourceCodeAnalysis != null) {
       
   825                 sourceCodeAnalysis.close();
       
   826             }
       
   827             InternalDebugControl.release(this);
   829         }
   828         }
   830     }
   829     }
   831 
   830 
   832     /**
   831     /**
   833      * Check if this JShell has been closed
   832      * Check if this JShell has been closed