thpatch / thcrap

Touhou Community Reliant Automatic Patcher
https://www.thpatch.net
The Unlicense
558 stars 41 forks source link

Debug DLLs being merely present crashes non Steam versions of ZUN games available on Steam #116

Closed 32th-System closed 4 years ago

32th-System commented 5 years ago

Video demonstration

According to the Visual Studio debugger this crash happens in line 97 of steam.cpp in a debug build

thcrap_log.txt

brliron commented 5 years ago

This is a known bug, but I'm not sure we have an open issue on Github.

Statically loaded DLLs don't do anything, but when it comes to plugins, stars fall from the sky, forests start burning, and kittens start getting killed. What happens is that both versions of the plugin get loaded (they both end with .dll, and they both have a function called thcrap_init). So, everything happens twice. And some things are not supposed to happen twice. If it didn't crash on the steamAPI_Init call, it would have crashed later.

DankRank commented 5 years ago

tl;dr don't mix debug and release versions

brliron commented 4 years ago

Fixed for the general case with 584391f55a816ae640f19d27fcd2d0e3b4b8290a. Please reopen if there are issues related to the Steam versions (or, of course, if the fix didn't work).