# NSInternalInconsistencyException crash

**URL:** <https://forum.xojo.com/t/nsinternalinconsistencyexception-crash/44874>\
**Category:** macOS\
**Created:** [August 17, 2018, 3:02pm UTC](https://forum.xojo.com/t/nsinternalinconsistencyexception-crash/44874 "2018-08-17T15:02:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frédéric\_QUOIREZ](https://forum.xojo.com/user_avatar/forum.xojo.com/fr%C3%A9d%C3%A9ric_quoirez/32/306_2.png) [@Frédéric\_QUOIREZ](https://forum.xojo.com/u/Fr%C3%A9d%C3%A9ric_QUOIREZ)\
**Post date:** [August 17, 2018, 3:02pm UTC](https://forum.xojo.com/t/nsinternalinconsistencyexception-crash/44874/1 "2018-08-17T15:02:25Z")

</div>

Hi,

Using Xojo 2017r2.1, I get a crash when launching a Cocoa app via Terminal & passing parameters like reported in these 2 feedback cases :  
\<[https://xojo.com/issue/37610](https://xojo.com/issue/37610)\>  
and  
\<[https://xojo.com/issue/37423](https://xojo.com/issue/37423)\>

According to Norman’ comment, I understood that we are not allowed to Quit while App.Event.Open is running…

So, at the end of the Open event, I added a timer with a single mode, a period of 100, and with a timer action “Quit”, hoping the timer action while run after the App.Event Open.

Not sure if this is s a good guess, but it works ! Tested with success on Maverick, Yosemite and High Sierra.

What do you think ? Is it a solid workaround ?

THanks, Fred

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [August 17, 2018, 3:14pm UTC](https://forum.xojo.com/t/nsinternalinconsistencyexception-crash/44874/2 "2018-08-17T15:14:09Z")

</div>

you could set autoquit property to true.

```auto
app.autoquit = true
```

so Xojo runtime quits the app.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [August 17, 2018, 3:14pm UTC](https://forum.xojo.com/t/nsinternalinconsistencyexception-crash/44874/3 "2018-08-17T15:14:33Z")

</div>

or call

```auto
ExitMBS(0)
```

to quit the app without running Xojo’s destructors.

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [August 17, 2018, 3:21pm UTC](https://forum.xojo.com/t/nsinternalinconsistencyexception-crash/44874/4 "2018-08-17T15:21:15Z")

</div>

For future reference, if you paste the thing that Feedback.app gives you when you select “Copy Sharing Link” the forum will turn that into the link for you 🙂

```auto
<[https://xojo.com/issue/37610](https://xojo.com/issue/37610)>
```

\<[https://xojo.com/issue/37610](https://xojo.com/issue/37610)\>

```auto
<[https://xojo.com/issue/37423](https://xojo.com/issue/37423)>
```

\<[https://xojo.com/issue/37423](https://xojo.com/issue/37423)\>

---

<div class="post-metadata">

**Author:** ![Frédéric\_QUOIREZ](https://forum.xojo.com/user_avatar/forum.xojo.com/fr%C3%A9d%C3%A9ric_quoirez/32/306_2.png) [@Frédéric\_QUOIREZ](https://forum.xojo.com/u/Fr%C3%A9d%C3%A9ric_QUOIREZ)\
**Post date:** [August 17, 2018, 4:10pm UTC](https://forum.xojo.com/t/nsinternalinconsistencyexception-crash/44874/5 "2018-08-17T16:10:30Z")

</div>

Thanks Christian.  
Is it more secure than using a timer ?

---

<div class="post-metadata">

**Author:** ![Frédéric\_QUOIREZ](https://forum.xojo.com/user_avatar/forum.xojo.com/fr%C3%A9d%C3%A9ric_quoirez/32/306_2.png) [@Frédéric\_QUOIREZ](https://forum.xojo.com/u/Fr%C3%A9d%C3%A9ric_QUOIREZ)\
**Post date:** [August 17, 2018, 4:13pm UTC](https://forum.xojo.com/t/nsinternalinconsistencyexception-crash/44874/6 "2018-08-17T16:13:19Z")

</div>

Hi Tim, thanks for the tip. I edit my post and correct it.

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [August 17, 2018, 4:31pm UTC](https://forum.xojo.com/t/nsinternalinconsistencyexception-crash/44874/7 "2018-08-17T16:31:09Z")

</div>

[quote=401268:@FrdricQUOIREZ]Thanks Christian.  
Is it more secure than using a timer ?[/quote]  
Well, what happens is that the ExitMBS method will exit your app without calling the Xojo destructors. Using a Timer means that both your app quits regularly and the Xojo destructors get called. I do not know what goes on in the destructors, but I’d lean toward the Timer option just to be on the safe side.

---

<div class="post-metadata">

**Author:** ![Frédéric\_QUOIREZ](https://forum.xojo.com/user_avatar/forum.xojo.com/fr%C3%A9d%C3%A9ric_quoirez/32/306_2.png) [@Frédéric\_QUOIREZ](https://forum.xojo.com/u/Fr%C3%A9d%C3%A9ric_QUOIREZ)\
**Post date:** [August 18, 2018, 1:17pm UTC](https://forum.xojo.com/t/nsinternalinconsistencyexception-crash/44874/8 "2018-08-18T13:17:57Z")

</div>

I did some tests, and app.autoquit doesn’t for my needs.

ExitMBS(0) does, but as Tim mentioned, it might be safer to quit regularly, so I’ll stay with the timer approach for now.

Thanks, Fred

---

<div class="post-metadata">

**Author:** ![Thomas\_Tempelmann](https://forum.xojo.com/user_avatar/forum.xojo.com/thomas_tempelmann/32/315_2.png) [@Thomas\_Tempelmann](https://forum.xojo.com/u/Thomas_Tempelmann)\
**Post date:** [July 16, 2020, 10:51am UTC](https://forum.xojo.com/t/nsinternalinconsistencyexception-crash/44874/9 "2020-07-16T10:51:19Z")

</div>

I just ran into the same issue with Arbed. Why the heck has this not been fixed, it’s been around for years. Damnit

It appears the condition for this bug is that it only happens when Quit is called from within the initial Open event. So, by either using a Timer (with Period 0) or even the NewDocument event, the Open Event is not running any more, and Quit can safely be called.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 7:19pm UTC](https://forum.xojo.com/t/nsinternalinconsistencyexception-crash/44874/10 "2020-10-29T19:19:53Z")

</div>


