When you come back I'll have already finished opm and u won't need to look at assembly ever again
When you come back I'll have already finished opm and u won't need to look at assembly ever again
Discord: RyBack#4239
fb: https://www.facebook.com/mohabhassan312
For now it crashes during map changes and when I disable hooking of script engine everything works fine, so I suspect that it possibly has to do with the fact that we rewrite and reallocate memory in DLLMain (to be able to extend the list of registered events), which is not recommended. Maybe something changed on Windows 10, I didn't test it on Win7 or XP but I might need to move that code to some function before G_Init and after LoadLibrary for gamex86. The problem with tracking where the problem is, is that AcLayer (Windows compatibility layer) hooks LoadLibrary and FreeLibrary and adds some logic to them, and going through those hooked implementations they return to invalid memory address, and I have no idea why, but I'm positive that we are not safe somewhere and AcLayer messes things up even more adding own hooks to those methods.
And regarding memory leak - yes it can be caused because of that. I believe that strings were created on stack, so compiler knew to free them on function exit, and when they were passed to Event result, they were copied so RAII wouldn't be broken. We allocate mem on stack as well, but when we assign C string (c_str) to the str object - we do this on heap (malloc), compiler has no idea that it should also call class destructor before cleaning up the stack.
Discord: RyBack#4239
fb: https://www.facebook.com/mohabhassan312