Random crashes in Yosemite with Xojo2019

I’ve been frustrated recently with apps built with Xojo 2019 r1 and r1.1 randomly crashing on Yosemite. The apps simply blink out of existence with no exceptions raised. Crashes occur in all parts of the app.

In checking MacOS crash logs, I noticed that this entry was always present:

com.xojo.XojoFramework 0x0000000108359f2d non-virtual thunk to CocoaPopupMenu::~CocoaPopupMenu() + 21

I’ve since determined that crashes happen randomly when a window containing populated popupmenus is closed. While this issue affects Yosemite, it may affect other OS versions that I am unable to test. It does not appear to affect Mojave.

As a workaround, I created a method to clear the popups:

Function ClearAllPopups extends w as window for i as integer = 0 to w.ControlCount-1 dim c as Control = w.Control(i) if c isa PopupMenu then PopupMenu(c).DeleteAllRows end if next End Function

Then on any window with popupmenus, I call ClearAllPopups at the end of the window’s close event.

Haven’t had a crash since.

a full crash log on a bug report with this information about the popup might help xojo track this down

I wrote on the other thread I thought it was ListBox the problem but you’re right, it’s PopupMenu. I add “MyPopupMenu1.DeleteAllRows and MyPopupMenu2.DeleteAllRows etc.” at the end of the CancelClose event (if not canceled) and I didn’t reach to have a crash.
Without this workaround, I need 10 times max to make the app crash, with this workaround I did it (open /close window) more than fifty times without a crash.
I’m running El Capitan and I have this problem since Xojo 2019r1 .
Richard, did you feel a report in feedback ?
Edit : Yes you did it : <https://xojo.com/issue/55785> .

Same issue here! Defo a bug.

step 1) get 2019r1.1
then try this again

I still had the bug with 2019r1.1 until I use the workaround. Still no crash since I did it.

I’d like to know if this happens also when popupmenus are only in the main window of an app.

Just be aware that accessing some forbidden parts of the system (like TimeMachine storage and so on) will lead to the immediate termination of your application!

I don’t have Yosemite so I cannot make tests, but what happens if instead of the workaround, you just add at the bottom of the cancelClose event:
exception//and nothing else

Moreover, in Xojo last releases I noticed that having code (for instance: quit) in the close event of the main window sometimes made apps crash with no explanation. And just removing the close event handler and if possible moving its code to the cancelClose event made the app stable.
As for the quit call I utterly removed it and set autoquit to true.

Yes, one of my app have a main window with 2 popupmenus and it crash (without the work around). This app have another window but it’s not used (information window).

with 2019 1.1, I get failures to compile after I add or remove breakpoints. There are some random crashes, usually related to my mis-typing fields from an SQLite data table. Part of it could be the dodgy keyboard on my MacBook Pro - I seem to be introducing some hidden rubbish from time to time and have to retype stuff. Very frustrating.