Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FT_HANDLE finalizer fails and can interfere with D2XXDevice operation #48

Open
ReubenHill opened this issue Jun 5, 2019 · 1 comment

Comments

@ReubenHill
Copy link
Collaborator

The FT_HANDLE finalizer sometimes still fails and seems to often interfere with operation of the D2XXDevice. An example of the finalizer failing:

julia> d = D2XXDevices(); open.(d); d = nothing; d = D2XXDevice(0); sleep(1.0); open(d)
ERROR: D2XXException("Device already open.")
Stacktrace:
 [1] open(::D2XXDevice) at C:\Users\Reuben\Documents\GitHub\LibFTD2XX\src\LibFTD2XX.jl:207
 [2] top-level scope at none:0

julia> GC.gc()
error in running finalizer: LibFTD2XX.Wrapper.FT_STATUS_ENUM(0x00000001)
error in running finalizer: LibFTD2XX.Wrapper.FT_STATUS_ENUM(0x00000001)
error in running finalizer: LibFTD2XX.Wrapper.FT_STATUS_ENUM(0x00000001)
error in running finalizer: LibFTD2XX.Wrapper.FT_STATUS_ENUM(0x00000001)
@ReubenHill
Copy link
Collaborator Author

Explicitly calling finalize(fthandle(d)) where d::D2XXDevice before d goes out of scope avoids errors but is messy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant