# Use of exit() in code

**URL:** <https://forum.mmgtools.org/t/use-of-exit-in-code/35>\
**Category:** Developers Help\
**Created:** [May 2, 2016, 4:04pm UTC](https://forum.mmgtools.org/t/use-of-exit-in-code/35 "2016-05-02T16:04:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![updega2](https://forum.mmgtools.org/letter_avatar_proxy/v4/letter/u/f475e1/32.png) [@updega2](https://forum.mmgtools.org/u/updega2)\
**Post date:** [May 2, 2016, 4:04pm UTC](https://forum.mmgtools.org/t/use-of-exit-in-code/35/1 "2016-05-02T16:04:27Z")

</div>

To the developers of mmg plan to continue using exit() in the code? It makes it hard for people who plan on using mmg inside another application because this causes the overall application to exit anytime there is an exit in mmg.

---

<div class="post-metadata">

**Author:** ![Algiane](https://forum.mmgtools.org/user_avatar/forum.mmgtools.org/algiane/32/30_2.png) [@Algiane](https://forum.mmgtools.org/u/Algiane)\
**Post date:** [May 3, 2016, 4:34pm UTC](https://forum.mmgtools.org/t/use-of-exit-in-code/35/2 "2016-05-03T16:34:51Z")

</div>

Hello,

Normally, we use exit() for very strong failures of the applications (lack of memory, unexpected cases…). But maybe you have found an exit() that must not be here?

We don’t plan for now to remove it.

Regards.

---

<div class="post-metadata">

**Author:** ![updega2](https://forum.mmgtools.org/letter_avatar_proxy/v4/letter/u/f475e1/32.png) [@updega2](https://forum.mmgtools.org/u/updega2)\
**Post date:** [May 3, 2016, 4:39pm UTC](https://forum.mmgtools.org/t/use-of-exit-in-code/35/3 "2016-05-03T16:39:54Z")

</div>

Okay, thanks for the response!

It was exiting when I used larger hausdorff values. It would give a warning about a geometrical problem, then INVALID ELEMENT, and then exit. It seems like this was a result of the remeshing process, not the input mesh, so I would’ve expected for it to return an error that it couldn’t mesh it or something.

I understand the motive in using exit() though, thanks!

---

<div class="post-metadata">

**Author:** ![Algiane](https://forum.mmgtools.org/user_avatar/forum.mmgtools.org/algiane/32/30_2.png) [@Algiane](https://forum.mmgtools.org/u/Algiane)\
**Post date:** [August 22, 2016, 7:22am UTC](https://forum.mmgtools.org/t/use-of-exit-in-code/35/4 "2016-08-22T07:22:29Z")

</div>

Closed on August 22, 2016, 7:22am UTC


