Memory blocks used to create FaceFX Runtime handles are invalidated during cooking
jcredmond opened this issue · comments
FScopedPlatformDataCooking is making copies of the PlatformData array, which is reallocating the RawData byte arrays that hold the memory blocks that the FaceFX Runtime uses. After a cook step, any handles created now point at free'd memory. It's pure luck that anything works after a cook in the editor -- as soon as something writes into the free'd memory the FaceFX Runtime handles are looking at corrupted memory from their point of view and this manifests in various errors as seen in #129 and #131.
The FaceFX Runtime 1.4.0-beta.7 verified this by enabling the memory integrity checks in every API even in release mode.
The fix for this using the Runtime 1.4.0 (being released soon) and UE 4.20 would be complicated. In the Runtime 1.5.0 the platform data will be unified and there will be no need for any PlatformData copying and no need for FScopedPlatformDataCooking at all and the problem will naturally go away. So rather than doing a complicated fix now and doing extensive testing we will fix it (simply) in a future update.