Drakynfly / HeartGraph

A generic runtime node graph editor and viewer for Unreal Engine
MIT License
91 stars 16 forks source link

Fix macOS compilation #21

Closed CrushedPixel closed 8 months ago

CrushedPixel commented 8 months ago

Clang on macOS appears to be stricter in a few regards than MSVC.

FFPropertyReadFunc shouldn't be a function reference because instances are created in-place in TReaderLambdaGen. To ensure proper lifetime of the function, the function iself must be passed as a value. This is corroborated by UE's documentation in Function.h:

TFunctionRef\ A class which represents a reference to something callable. The important part here is reference - if you bind it to a lambda and the lambda goes out of scope, you will be left with an invalid reference.

With regards to the changes to the if statements, I think we can all agree that this shouldn't have worked in the first place.