File tree Expand file tree Collapse file tree 3 files changed +21
-7
lines changed
Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ dist: xenial
44
55dotnet : 2.1.401
66mono :
7- - 5.14.0
87 - latest # => "stable release"
98 - alpha
109 - beta
@@ -23,7 +22,6 @@ script:
2322matrix :
2423 fast_finish : true
2524 allow_failures :
26- - mono : latest
2725 - mono : alpha
2826 - mono : beta
2927 - mono : weekly
Original file line number Diff line number Diff line change 1+ {
2+ "workbench.colorCustomizations" : {
3+ "tab.unfocusedActiveBorder" : " #fff0"
4+ }
5+ }
Original file line number Diff line number Diff line change @@ -47,12 +47,23 @@ module Types =
4747
4848 [<AutoOpen>]
4949 module Inner =
50- type DisposableList ( disposables : IDisposable list ) =
50+ open System.Collections .Generic
51+
52+ type DisposableStack () =
53+ let stack = Stack< IDisposable>()
54+
5155 interface IDisposable with
5256 member __.Dispose () =
53- disposables |> List.iter( fun d -> try d.Dispose() with e -> printfn " %A " e)
57+ while stack.Count > 0 do
58+ stack.Pop() .Dispose()
59+
60+ member __.Push ( item : IDisposable ) = stack.Push item
61+ member __.Push ( items : IDisposable list ) = items |> List.iter stack.Push
5462
55- static member Create ( disposables : IDisposable list ) = new DisposableList( disposables)
63+ static member Create ( items : IDisposable list ) =
64+ let ds = new DisposableStack()
65+ ds.Push items
66+ ds
5667
5768 type ILog with
5869
@@ -69,8 +80,8 @@ module Types =
6980 use __ =
7081 log.AdditionalNamedParameters
7182 |> List.map( fun ( key , value , destructure ) -> logger.MappedContext key value destructure)
72- |> List.rev // This reverse is important, it causes us to unwind as if you have multiple uses in a row
73- |> DisposableList .Create
83+ // This stack is important, it causes us to unwind as if you have multiple uses in a row
84+ |> DisposableStack .Create
7485
7586 log.Parameters
7687 |> List.toArray
You can’t perform that action at this time.
0 commit comments