File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -250,12 +250,14 @@ public void Dispose()
250
250
using var dnsCheckWaitHandle = new ManualResetEvent ( false ) ;
251
251
m_dnsCheckTimer . Dispose ( dnsCheckWaitHandle ) ;
252
252
dnsCheckWaitHandle . WaitOne ( ) ;
253
+ m_dnsCheckTimer = null ;
253
254
}
254
255
if ( m_reaperTimer is not null )
255
256
{
256
257
using var reaperWaitHandle = new ManualResetEvent ( false ) ;
257
258
m_reaperTimer . Dispose ( reaperWaitHandle ) ;
258
259
reaperWaitHandle . WaitOne ( ) ;
260
+ m_reaperTimer = null ;
259
261
}
260
262
#endif
261
263
}
Original file line number Diff line number Diff line change @@ -25,6 +25,17 @@ public void OpenConnection()
25
25
Assert . Equal ( ConnectionState . Open , connection . State ) ;
26
26
}
27
27
28
+ [ Fact ]
29
+ public void DoubleDispose ( )
30
+ {
31
+ using var dbSource = new MySqlDataSource ( AppConfig . ConnectionString ) ;
32
+ using ( var connection = dbSource . OpenConnection ( ) )
33
+ {
34
+ Assert . Equal ( ConnectionState . Open , connection . State ) ;
35
+ }
36
+ dbSource . Dispose ( ) ;
37
+ }
38
+
28
39
[ Fact ]
29
40
public async Task OpenConnectionAsync ( )
30
41
{
You can’t perform that action at this time.
0 commit comments