vizor-games / InfraworldRuntime

A solution that enables Unreal Engine 4 to work with Google gRPC services from either C++ or Blueprints.
Apache License 2.0
169 stars 56 forks source link

Fixed an issue where engine would crash randomly, especially when changing scenes #14

Closed koriandrei closed 5 years ago

koriandrei commented 5 years ago

When a RPC client is destroyed by GC, which is always called when changing scenes, there could be an issue where its Conduits would be destroyed, and then FRunnableThread would try to access them, crashing the engine in process. To mitigate this, BeginDestroy, which is called before destructor, would Stop the RPC client; also, FRunnableThread is stored via an Atomic; this fixes synchronization issues with multiple calls to Stop()