Fixed crash on windows deactivate