VirtualBox

Changeset 53483 in vbox


Ignore:
Timestamp:
Dec 8, 2014 4:57:07 PM (10 years ago)
Author:
vboxsync
Message:

Additions/VBoxGuest: never do input_free_device() after input_unregister_device()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c

    r52700 r53483  
    134134#ifdef VBOXGUEST_WITH_INPUT_DRIVER
    135135static struct input_dev        *g_pInputDevice = NULL;
     136static bool                     g_fInputDeviceRegistered = false;
    136137#endif
    137138
     
    451452            return rc;
    452453        }
     454        g_fInputDeviceRegistered = true;
    453455    }
    454456    /* Do what one of our competitors apparently does as that works. */
     
    475477{
    476478    VbglGRFree(&g_pMouseStatusReq->header);
    477     input_unregister_device(g_pInputDevice);
    478     input_free_device(g_pInputDevice);
     479    /* see documentation of input_register_device() */
     480    if (g_fInputDeviceRegistered)
     481        input_unregister_device(g_pInputDevice);
     482    else
     483        input_free_device(g_pInputDevice);
    479484}
    480485#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette