There are two bugs in this report. Since I could NOT reproduce them in a fresh .cap, I am including the original.
1) Crash on runtime exit: occurs if the Inventory (hashtable object) is in a container with Entity (sprite object). Does not occur anymore if you remove Hashtable.
See: Inventory (hash table object), Entity (sprite object) on Demo layout
2) Trail particle object: it contains itself (repeats in the containers list). Leftover from an attempt at instance containers.
See: Trail (particle object) on Demo layout.
It would save me hours of time if you can reproduce this in a simpler application. As it is it would be extremely complicated to debug. Try deleting as much as you can from the .cap and still have the problem occur.
Trimmed version
Okay, I've trimmed the cap down as much as possible while still crashing on exit. It boils down to the Spawn Ships and Enemy Controls groups in Ships sheet. Disabling either eliminates the crashing.
Also, the 'trail' particle object is still containing itself.