Fix crash with 3.1 context when cleaning rtt.