File tree Expand file tree Collapse file tree
JShellAPI/src/main/java/org/togetherjava/jshellapi/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -182,16 +182,17 @@ public String id() {
182182 @ Override
183183 public void close () {
184184 try {
185+ dockerService .killContainerByName (containerName ());
185186 try {
186187 writer .close ();
187188 } finally {
188189 reader .close ();
189190 }
190- dockerService .killContainerByName (containerName ());
191191 } catch (IOException ex ) {
192192 throw new RuntimeException (ex );
193+ } finally {
194+ sessionService .notifyDeath (id );
193195 }
194- sessionService .notifyDeath (id );
195196 }
196197
197198 @ Override
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ private void initScheduler() {
3939 }
4040 void notifyDeath (String id ) {
4141 JShellService shellService = jshellSessions .get (id );
42+ if (shellService == null ) return ;
4243 if (!shellService .isClosed ()) {
4344 throw new RuntimeException ("JShell Service isn't dead when it should for id " + id );
4445 }
You can’t perform that action at this time.
0 commit comments