Built App Crashes, under debugger runs fine

I have a somewhat complex desktop application. Works fine under Mac OS X. Build it for Windows crashes every time with no message other than Window message saying it has stopped working. But if I run it via the remote debugger, it works fine. I am pulling my hair out here…

does it contain any code that is OSX specific? If so, it needs to be isolated using pragmas
If it is 100% pure XOJO with no declares, then its hard to tell

If Dave’s answer does not help, try changing the compatibility setting in the .exe properties and see if that makes a difference.

There is no OS X specific code. I added a bunch of System.DebugLog statements and isolated it down to some calls closing the DB connection. I commented those out and now it runs fine. This still does not answer the question as to why it did not crash under the debugger but crashed as a standalone exe.

Some more debugging happened. So it appears that trying to close the db, a network based MySQL server, is my issue. If I eliminate those calls, no crashing. I thought best practice was to close the connection when you are done with it. And why does Windows only crash were OS X just keeps chugging along? Is there a difference on how the MySQL plugin works under OS X versus Windows?

There could just plain be a bug in the Windows code.
While lots of the code is shared between OS X, Linux & Windows it is possible to have a Windows specific bug in the plugin.
Something like <https://xojo.com/issue/43358>