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

File system watchers are not held and/or disposed #268

Closed
ghost opened this issue Oct 25, 2013 · 9 comments
Closed

File system watchers are not held and/or disposed #268

ghost opened this issue Oct 25, 2013 · 9 comments

Comments

@ghost
Copy link

ghost commented Oct 25, 2013

The helper here https://github.com/fsharp/fsharpx/blob/master/src/FSharpx.TypeProviders/TypeProvider.Helper.fs#L24

creates a FileSystemWatcher but never disposes it. This will result in either memory leaks or early disposal of the watcher (and hence events won't be raised).

A handle to the FileSystemWatcher should be kept in the type provider object and IDisposable should be implemented by the type provider object. Compare with this

https://github.com/fsharp/fsharp/blob/master/src/fsharp/FSharp.Data.TypeProviders/TypeProviders.fs#L265

@forki
Copy link
Member

forki commented Oct 25, 2013

We should probably upgrade the TypeProvider.fs and remove the watchForChanges stuff

@ghost
Copy link
Author

ghost commented Oct 25, 2013

We should probably upgrade the TypeProvider.fs and remove the watchForChanges stuff

Nah, that "TypeProviders.fs" I linked to isn't the TypeProviderEmit API, it's the implementation of the FSharp.Data.TypeProviders.dll. There's not currently any reusable helpers for managing this.

@forki
Copy link
Member

forki commented Oct 25, 2013

Seems this bug has been spread all over the type providers...

@ovatsus
Copy link

ovatsus commented Oct 25, 2013

@forki, I fixed it in FSharp.Data, you can merge from there if you want

@ovatsus
Copy link

ovatsus commented Oct 25, 2013

@forki
Copy link
Member

forki commented Oct 25, 2013

It seem I need someone to make it compile in VS2013 first

@ovatsus
Copy link

ovatsus commented Oct 25, 2013

what do you mean?

@forki
Copy link
Member

forki commented Oct 25, 2013

The .fsproj files are completely broken in VS2013 and do not compile. Probably the same as fsprojects/FAKE#180

@ovatsus
Copy link

ovatsus commented Oct 25, 2013

Humm, it's building for me both in VS2013 and VS2012

@fsgit
Copy link
Contributor

fsgit commented Sep 26, 2014

Closing as the type providers have all been moved to other projects like https://github.com/fsprojects/FSharp.Configuration and https://github.com/fsprojects/ExcelProvider

@fsgit fsgit closed this as completed Sep 26, 2014
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

3 participants