Skip to content

Commit 20ddd65

Browse files
committed
添加 IDisposable
1 parent e51e272 commit 20ddd65

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/Apache.IoTDB/DataStructure/SessionDataSet.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Apache.IoTDB.DataStructure
88
{
9-
public class SessionDataSet
9+
public class SessionDataSet: System.IDisposable
1010
{
1111
private readonly long _queryId;
1212
private readonly string _sql;
@@ -306,6 +306,17 @@ public async Task Close()
306306
_clientQueue.Add(myClient);
307307
}
308308
}
309-
}
309+
}
310+
~SessionDataSet()
311+
{
312+
this.Dispose();
313+
}
314+
315+
316+
public void Dispose()
317+
{
318+
this.Close().Wait();
319+
320+
}
310321
}
311322
}

0 commit comments

Comments
 (0)