VirtualBox

Changeset 3662 in vbox for trunk/src/VBox/Main/darwin


Ignore:
Timestamp:
Jul 17, 2007 1:22:40 AM (17 years ago)
Author:
vboxsync
Message:

Fixed memory leak (hubs).

Location:
trunk/src/VBox/Main/darwin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/darwin/iokit.cpp

    • Property svn:keywords set to Id
    r3376 r3662  
    1 /** $Id: $ */
     1/* $Id$ */
    22/** @file
    33 * Main - Darwin IOKit Routines.
     
    548548
    549549/**
     550 * Worker function for DarwinGetUSBDevices() that tries to figure out
     551 * what state the device is in.
     552 *
     553 * This is mostly a matter of distinguishing between devices that nobody
     554 * uses, devices that can be seized and devices that cannot be grabbed.
     555 *
     556 * @param   pCur        The USB device data.
     557 * @param   USBDevice   The USB device object.
     558 * @param   PropsRef    The USB device properties.
     559 */
     560static void darwinDeterminUSBDeviceState(PUSBDEVICE pCur, io_object_t USBDevice, CFMutableDictionaryRef PropsRef)
     561{
     562    ///@todo
     563}
     564
     565
     566/**
    550567 * Enumerate the USB devices returning a FIFO of them.
    551568 *
     
    604621                 */
    605622                pCur->bcdUSB = 0;                                           /* we've no idea. */
    606                 pCur->enmState = USBDEVICESTATE_USED_BY_HOST_CAPTURABLE;    /* ditto. */
     623                pCur->enmState = USBDEVICESTATE_USED_BY_HOST_CAPTURABLE;    /* just a default, we'll try harder in a bit. */
    607624
    608625                AssertBreak(darwinDictGetU8(PropsRef,  CFSTR(kUSBDeviceClass),           &pCur->bDeviceClass),);
     
    667684                }
    668685#endif
     686                /*
     687                 * Try determin the state.
     688                 */
     689                darwinDeterminUSBDeviceState(pCur, USBDevice, PropsRef);
    669690
    670691                /*
     
    681702            /* cleanup on failure / skipped device. */
    682703            if (!fOk && pCur)
    683             {
    684                 /** @todo */
    685             }
     704                DarwinFreeUSBDeviceFromIOKit(pCur);
    686705
    687706            CFRelease(PropsRef);
     
    704723     * take the first one from another vendor.
    705724     */
     725    /* As it turns out, the HID service will take all keyboards and mice
     726       and we're not currently able to seize them. */
    706727    PUSBDEVICE pMouse = NULL;
    707728    PUSBDEVICE pKeyboard = NULL;
  • trunk/src/VBox/Main/darwin/iokit.h

    • Property svn:keywords set to Id
    r2981 r3662  
    1 /** $Id: $ */
     1/* $Id$ */
    22/** @file
    33 * Main - Darwin IOKit Routines.
     
    2727#ifdef VBOX_WITH_USB
    2828# include <VBox/usb.h>
    29 #endif 
     29#endif
    3030
    3131/**
     
    4040} DARWINDVD, *PDARWINDVD;
    4141
    42 /** The run loop mode string used by iokit.cpp when it registers 
     42/** The run loop mode string used by iokit.cpp when it registers
    4343 * notifications events. */
    4444#define VBOX_IOKIT_MODE_STRING "VBoxIOKitMode"
     
    5050void        DarwinUnsubscribeUSBNotifications(void *pvOpaque);
    5151PUSBDEVICE  DarwinGetUSBDevices(void);
     52void        DarwinFreeUSBDeviceFromIOKit(PUSBDEVICE pCur);
    5253#endif
    5354__END_DECLS
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