You need to make sure you exit the loop at some point. This is why in the example I provided, I fill an array before starting the loop, then in each execution I grab the first element and remove it from the array.
If you wanna switch to c++, look into FStreamableManager
→ RequestAsyncLoad
, which is much more convenient as it can effectively load batches. You simply give it an array of SoftObjectPtr/SoftObjectPath.