mkxp-z / mkxp-z

Open-source cross-platform player for (some) RPG Maker XP / VX / VX Ace games. A very heavily modified fork of mkxp. RGSS on steroids with a stupid name.
https://github.com/mkxp-z/mkxp-z/wiki
GNU General Public License v2.0
140 stars 39 forks source link

mkxp-z hangs when closed while booting #157

Closed enumag closed 1 month ago

enumag commented 5 months ago

If I try to close the game while mkxp-z is booting it hangs:

image

Previously reported on Discord, there is some related discussion here: https://discord.com/channels/735621087211028620/1141787535043993681/1198217438869852170

Eblo commented 5 months ago

I have seen this personally when trying to close the application when it's handling the path cache at startup. I'm not sure if that's the only cause at startup.

Perhaps unrelated, but highlighting the debug console as it's trying to print something regularly will halt the thread of whatever is printing until you cancel the highlight. If that is the main thread and you let it go for too long, you'll get this. Since this is a debug console, I don't think that itself is an issue, but it might be a clue into what's going on here.

WaywardHeart commented 5 months ago

I've noticed this, too, and this issue finally got me to take a look at it. My PR doesn't address the debug console thing - that sounds like the debugger is just halting the ruby thread, and mkxp-z eventually notices that nothing's happening and decides that something must be wrong.

https://github.com/mkxp-z/mkxp-z/blob/8ccbc046ed33e27e191a28aff350261ba7cf6dd7/src/eventthread.cpp#L224-L228 Just looking at the code, I think the debugger is probably setting off this check here somehow, but I don't care enough to look beyond that.

enumag commented 5 months ago

Thanks for yet another fix @WaywardHeart ! Gonna steal that for my fork haha.