File tree 3 files changed +21
-7
lines changed
3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ dist: xenial
4
4
5
5
dotnet : 2.1.401
6
6
mono :
7
- - 5.14.0
8
7
- latest # => "stable release"
9
8
- alpha
10
9
- beta
@@ -23,7 +22,6 @@ script:
23
22
matrix :
24
23
fast_finish : true
25
24
allow_failures :
26
- - mono : latest
27
25
- mono : alpha
28
26
- mono : beta
29
27
- 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 =
47
47
48
48
[<AutoOpen>]
49
49
module Inner =
50
- type DisposableList ( disposables : IDisposable list ) =
50
+ open System.Collections .Generic
51
+
52
+ type DisposableStack () =
53
+ let stack = Stack< IDisposable>()
54
+
51
55
interface IDisposable with
52
56
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
54
62
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
56
67
57
68
type ILog with
58
69
@@ -69,8 +80,8 @@ module Types =
69
80
use __ =
70
81
log.AdditionalNamedParameters
71
82
|> 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
74
85
75
86
log.Parameters
76
87
|> List.toArray
You can’t perform that action at this time.
0 commit comments