fix x-plane crashing on exit

Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>