Hi. Just wanted to post a separate message about this.
Fixed in github master now.
For a long time we have had crashes when simply loading another song or selecting File > New or File > Close.
It usually happens when various editor windows are already open.
I have now tested re-loading various simple and complicated songs over and over and over again, with no crashes.
You should be able to do the same now.
Please let me know if any trouble.
[ Tech talk: ]
Each of us has tried various fixes over the years, but no one got to the heart of the matter.
There is a section of code that wants to a) close all open windows and then b) clear the song of all tracks, parts, markers, tempos etc.
Some of the windows are marked as 'delete on close' meaning they delete themselves after closing.
And there's the trouble. Calling close() on such windows does NOT immediately delete at the end, it calls deleteLater(),
to be deleted at a later time.
This meant that the various windows were still alive when we next attempted to clear the song of all tracks, parts etc.
Also various connections to the windows such as our GUI heartbeat timer, our songChanged, and our configChanged signals
were still alive at the time of clearing the song.
So the still-alive windows were then attempting to use these now-deleted tracks, parts etc.
Crash!
So it was imperative that we wait until the windows have really been deleted before moving on to clearing the song.
Simply calling processEvents() in a loop did nothing to help.
It turns out that we must call QCoreApplication::sendPostedEvents() instead.
From help on processEvents():
In the event that you are running a local loop which calls this function continuously, without an event loop,
the DeferredDelete events will not be processed. This can affect the behaviour of widgets, e.g. QToolTip,
that rely on DeferredDelete events to function properly. An alternative would be to call sendPostedEvents()
from within that local loop.
OK. Except it didn't work. Simply calling sendPostedEvents() with default arguments should have worked but it didn't.
So after some searching, thank the coding Gods I found this old post:
https://lists.qt-project.org/pipermail/ ... 22513.html
It turns out there's some kind of slight Qt bug where specifically for DeferredDelete events,
the poster had to specifically call "sendPostedEvents(0, QEvent::DeferredDelete)".
Presto! Problem solved!
All the windows deleted and then I could move on to clearing the song safely.
This took me the whole weekend to solve and I just found the solution and fixed it this Monday morning.
I was about ready to give up and try some really exotic stuff like running another QThread etc.
which likely would not have worked.
See ya!