On 26/06/13 15:44, Hans de Goede wrote:
> Hi,
>
> On 06/26/2013 03:30 PM, Hans de Goede wrote:
>> Hi,
>>
>> Thanks for the patch, pushed to master.
> On second thought, I've found a problem with your patch,
> after your patch the code always unrefs dev, but if
> usbi_get_device_by_session_id() succeeds it returns a
> so called borrowed reference, so we should not unref it.

Good spot. Thanks for noticing that.

>
> I've just written and pushed a patch fixing this, by
> doing libusb_ref_device on dev if
> usbi_get_device_by_session_id() succeeds, turning
> the borrowed ref into a real ref (which we then later
> unref).
>
> Please test!

All seems good with my testing. I think I'll try to write a test for 
this, although I'll need to have a think about the simplest way for 
testing the usbi_get_device_by_session_id() success path.

Regards,

Toby

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to