Эксперт
-
Автор темы
- #1
the real issue here is the dll randomly crashing at runtime without exceptions / error messages...
I was trying to see what was causing the problem, and basically found out this function is not working properly.
The second line of code seems to be what's causing the crash...
This is how i am calling the function...
```
You can find the ImTricks code here:
This problem only verifies in my dll project...
I made another project that uses the same function called in the same way at the same time but everything works good...
So maybe some project setting / properties needs to be edited...
I was trying to see what was causing the problem, and basically found out this function is not working properly.
The second line of code seems to be what's causing the crash...
FastFloatLerp:
float FastFloatLerp(std::string identifier, bool state, float min, float max, float speed)
{
static std::unordered_map<std::string, float> valuesMapFloat;
auto value = valuesMapFloat.find(identifier); // -> CRASH HERE
const float frameRateSpeed = speed * (1.f - ImGui::GetIO().DeltaTime);
if (state) {
if (value->second < max)
value->second += frameRateSpeed;
}
else {
if (value->second > min)
value->second -= frameRateSpeed;
}
value->second = std::clamp(value->second, min, max);
return value->second;
}
calling of function:
float anim = ImTricks::Animations::FastFloatLerp("theme_anim" , light, 0.f, 1.f, GetIO().DeltaTime * 3);
You can find the ImTricks code here:
Пожалуйста, авторизуйтесь для просмотра ссылки.
This problem only verifies in my dll project...
I made another project that uses the same function called in the same way at the same time but everything works good...
So maybe some project setting / properties needs to be edited...