Skip to content

Commit 69dfe0e

Browse files
authored
Merge pull request #1493 from Thorium/fix1466
2 parents d1e479f + ac25c6f commit 69dfe0e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • src/FSharp.Data.DesignTime/CommonProviderImplementation

src/FSharp.Data.DesignTime/CommonProviderImplementation/Helpers.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ module internal ReflectionHelpers =
8080
type DisposableTypeProviderForNamespaces(config, ?assemblyReplacementMap) as x =
8181
inherit TypeProviderForNamespaces(config, ?assemblyReplacementMap = assemblyReplacementMap)
8282

83+
let lockObj = Object()
8384
let disposeActions = ResizeArray()
8485

8586
static let mutable idCount = 0
@@ -90,7 +91,7 @@ type DisposableTypeProviderForNamespaces(config, ?assemblyReplacementMap) as x =
9091
do idCount <- idCount + 1
9192

9293
let dispose typeNameOpt =
93-
lock disposeActions (fun () ->
94+
lock lockObj (fun () ->
9495
for i = disposeActions.Count - 1 downto 0 do
9596
let disposeAction = disposeActions.[i]
9697
let discard = disposeAction typeNameOpt
@@ -115,7 +116,7 @@ type DisposableTypeProviderForNamespaces(config, ?assemblyReplacementMap) as x =
115116
| _ -> None)
116117

117118
member _.AddDisposeAction action =
118-
lock disposeActions (fun () -> disposeActions.Add action)
119+
lock lockObj (fun () -> disposeActions.Add action)
119120

120121
member _.InvalidateOneType typeName =
121122
(use _holder = logTime "InvalidateOneType" (sprintf "%s in %O [%d]" typeName x id)

0 commit comments

Comments
 (0)