Closed joluch closed 2 years ago
Can you reproduce this behavior within any executable? I'll try to reproduce this behavior locally, and if possible, try to determine the cause. With that said, albeit unlikely (if it happens deterministically), threads not being synchronized may be the issue.
Having made heavy use of detours and lazy statics I'm thinking this should be closed as user error.
Some advice if you're not starting the application in a suspended state then you should manually call suspend on all non-library threads before initialization and resume after. By the looks of this though you're not synchronizing at all since you're not resuming the main thread either... so yes you likely got caught by a synchronization issue here unfortunately.
When using
detour-rs
in conjunction withlazy_static
in a loop something goes very wrong, to the point where nothing in the program works.When using
lazy_static
in a loop, e.g. in this case:and then detouring a function, e.g. d3d9 EndScene:
the whole program failes to execute, and dosen't even allocate a console, like it should:
Both functions function like expected when used seperately but when both are ran, it seems like it fails completely to execute. If the
lazy_static
HashMap is used outside a loop it functions completely normally.