Crash caused by AddStateBagChangeHandler
Marky-S opened this issue · 2 comments
Marky-S commented
Hi!
Client-side.
Commands:
- test1 - all ok, it’s working
- test2 - i crashing instantly:
CfxCrashDump_2023_05_24_11_59_55.zip (1.5 MB) - test3 - all ok, it’s working before first resource “hot reload” after which crash
CfxCrashDump_2023_05_24_12_03_12.zip (1.6 MB)
[Command("test1")]
private void RegisterStateBagChangeSingleHandler_Ok()
{
Natives.AddStateBagChangeHandler("abc", null, new Action<string, string, object, int, bool>(StateBagChanged));
}
[Command("test2")]
private void RegisterStateBagChangeHandlers_InstantCrash()
{
Natives.AddStateBagChangeHandler("abc", null, new Action<string, string, object, int, bool>(StateBagChanged));
Natives.AddStateBagChangeHandler("abc_2", null, new Action<string, string, object, int, bool>(StateBagChanged2));
}
[Command("test3")]
private async void RegisterStateBagChangeHandlers_CrashAfterHotReload()
{
Natives.AddStateBagChangeHandler("abc", null, new Action<string, string, object, int, bool>(StateBagChanged));
await WaitUntilNextFrame();
Natives.AddStateBagChangeHandler("abc_2", null, new Action<string, string, object, int, bool>(StateBagChanged2));
}
private void StateBagChanged2(string bagName, string key, object value, int reserved, bool replicated)
{
Debug.WriteLine($"{bagName} {key} {value} {reserved} {replicated}");
}
private void StateBagChanged(string bagName, string key, object value, int reserved, bool replicated)
{
Debug.WriteLine($"{bagName} {key} {value} {reserved} {replicated}");
}
thorium-cfx commented
This was an interesting one and may even solve another issue we couldn't solve 🤞 Fix will come with the next bug-fix update as well!
Repro steps were great, loved it, had no issues replicating them.
Marky-S commented
Repro steps were great, loved it, had no issues replicating them.
I, as a developer who has much worked with a young, dumby, but muuuuuch loved testers team, understand what information is needed for understanding the context and fast solve 😂