Thread Safety for Event Dispatcher broadcasting using AsyncTask

yups the symptom is a race condition. i’m trying to figure out why it triggers.
apparently that code can handle being called from other threads, but it’s failing a check for race conditions.

i think the problem is on whatever code is subscribed to your delegate.

because i don’t see an issue with the MoveTemp(TArary)
and being on the gamethread dispatching a delegate should be fine.
i’ve dispatched delegates on bg threads so that’s fine.

what confuses me is that being on the main thread you "shouldn’t":trade_mark: have issues like those.

try disconnecting everything from the delegate and see if that works. then try again.

my another guess is that “CallBackObj” is a custom object that somehow is getting auto-destroyed when the lambda finishes. and possibly from another thread.
but i would have expected a much longer stack trace if that were the case and a segfault not a race condition. but chances are that object could be doing something weird.

1 Like