You should be able to add the UObjects as root objects so they won’t be garbage collected. Just make sure you have some kind of RAII structure in place that removes the objects from the root set again at the end of the test.
1 Like