def stop(win, ctx):
    """Stop and unload any active JoyCursors for the given *ctx*.
    """
    if hasattr(ctx, 'joycursor'):
        ctx.joycursor.activated = False
        win.unbind(children=ctx.joycursor.on_window_children, on_keyboard=
            ctx.joycursor.keyboard_shortcuts)
        win.funbind('on_joy_button_down', ctx.joycursor.joystick_shortcuts)
        win.remove_widget(ctx.joycursor)
        del ctx.joycursor
