I was testing my latest builds (using JUCE 5.3.2), and saw my host (Cubase 10) crash when I closed my project, without quitting Cubase, and with my plugin still open. The crash log shows this:
Crashed Thread: 33 JUCE Timer Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000001299d4ffe Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler  VM Regions Near 0x1299d4ffe: MALLOC_LARGE 000000012959a000-000000012991a000 [ 3584K] rw-/rwx SM=PRV --> mapped file 000000012bc4e000-000000012bdad000 [ 1404K] r-x/rwx SM=COW Thread 33 Crashed:: JUCE Timer 0 ??? 0x00000001299d4ffe 0 + 4993142782 1 ??? 0x00000001299ff51b 0 + 4993316123 2 ??? 0x00000001299dad6c 0 + 4993166700 3 libsystem_pthread.dylib 0x00007fff6e912661 _pthread_body + 340 4 libsystem_pthread.dylib 0x00007fff6e91250d _pthread_start + 377 5 libsystem_pthread.dylib 0x00007fff6e911bf9 thread_start + 13
I don’t recall seeing this before, and don’t know of any changes that I have made that are related to the timer. My processor and editor classes both derive publicly from Timer, so they should destroy themselves normally, shouldn’t they? Is there something I need to do in my classes’ destructors to prevent the timers from firing and leading to this crash? Do I have to loop until the timer callbacks exit (checking a member flag that I set on entry and reset on exit to the timer callbacks)?
EDIT: I added stopTimer() calls at the start of my destructors, and also added guards around the code in the timer callbacks to ensure they aren’t re-entered, and even added a loop in the destructor to make sure the timer callbacks had finished before proceeding with the destructor code, but none of those helps. I still get JUCE Time crashes when closing my project in Cubase 10 with my plugin open.