Open ghost opened 7 years ago
Is this bug reproducible? If the exception is caught by the exception handler, then it must be somewhere else. Maybe the WRITE macro itself fails ...
https://github.com/shadowlif/Open_SAMP_API_ReproduceableCrash (also as Release) Maybe it's crashing because of an missing mutex here https://github.com/SAMPProjects/Open-SAMP-API/blob/master/src/Open-SAMP-API/Game/Rendering/Renderer.cpp#L38
That might be a reason because C++ STL containers are not thread safe. Does it still crash if you add the missing mutex there?
Nope, also I thought about it. Is safeExecuteWithValidation
even catching an exception?
Maybe not because SAMP set the UnhandledExceptionHandler.
E.g.
WRITE(int(Utils::SafeBlock::safeExecuteWithValidation([&](){ Rendering::Renderer::sharedRenderer().getAs<Rendering::Box>(id)->setBoxHeight(height); })));
id is invalid, a nullptr is returned and is used. Normally the try/catch should get it, but SAMP raise an exception dialog before. The game is running and not crashed, so the safeExecuteWithValidation works.