File tree Expand file tree Collapse file tree
core/native/src/main/scala/cats/effect Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -413,14 +413,14 @@ trait IOApp {
413413 // threads to gracefully complete their work, and managed
414414 // environments to execute their own shutdown hooks.
415415 } else {
416- halt (ec.code)
416+ System .exit (ec.code)
417417 }
418418
419419 done = true
420420
421421 case _ : CancellationException =>
422422 // Do not report cancelation exceptions but still exit with an error code.
423- halt (1 )
423+ System .exit (1 )
424424
425425 case t : Throwable =>
426426 if (UnsafeNonFatal (t)) {
@@ -448,8 +448,14 @@ trait IOApp {
448448 }
449449 }
450450
451- private [this ] def halt (status : Int ): Unit = System .exit(status)
452-
451+ private [this ] def halt (status : Int ): Unit = {
452+ // TODO: This should be `Runtime#halt` (i.e.,
453+ // TODO: not call shutdown hooks), but that is
454+ // TODO: unavailable on scala-native. Note,
455+ // TODO: that `stdlib.exit` seems to be the
456+ // TODO: same as `System.exit` currently.
457+ System .exit(status)
458+ }
453459}
454460
455461object IOApp {
You can’t perform that action at this time.
0 commit comments