Quantcast

How should Ftdi::List and Ftdi::Context lifetimes be managed?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How should Ftdi::List and Ftdi::Context lifetimes be managed?

Owen
Hello,

I have a question about how to properly use Ftdi::List and Ftdi::Context. I want to make sure that I won't leak memory or double-delete something.

Does deleting an Ftdi::List delete all the Ftdi::Context objects that came from it, including open ones? So does that mean that contexts individually should not be deleted? Also should contexts be closed before the list is deleted?

Also, if I list devices, and I see a list of devices A, B, and C, and I open only B, does that Ftdi::List existing in memory prevent another thread from listing and opening A or C?

Best,
Owen


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


Loading...