The branch, master has been updated
       via  0c33162ce187821cb670013c2f903a0dbc4bf707 (commit)
      from  de40c606f2a72bbcb27444c6e3c40debb58c8723 (commit)


- Log -----------------------------------------------------------------
commit 0c33162ce187821cb670013c2f903a0dbc4bf707
Author: Uwe Bonnes <[email protected]>
Date:   Tue Jun 28 16:08:20 2011 +0200

    Increment the refcount on devices we return from ftdi_usb_find_all()

-----------------------------------------------------------------------

Summary of changes:
 src/ftdi.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/ftdi.c b/src/ftdi.c
index e3862a8..57730d9 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -299,7 +299,7 @@ int ftdi_usb_find_all(struct ftdi_context *ftdi, struct 
ftdi_device_list **devli
 
             (*curdev)->next = NULL;
             (*curdev)->dev = dev;
-
+            libusb_ref_device(dev);
             curdev = &(*curdev)->next;
             count++;
         }
@@ -320,6 +320,7 @@ void ftdi_list_free(struct ftdi_device_list **devlist)
     for (curdev = *devlist; curdev != NULL;)
     {
         next = curdev->next;
+        libusb_unref_device(curdev->dev);
         free(curdev);
         curdev = next;
     }


hooks/post-receive
-- 
port libftdi to libusb-1.0

--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [email protected]   

Reply via email to