fix use-after-free crash in RT #97625