Fixed #5502 (FP: Dereferencing 'b' after it is deallocated / released)