File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Data/BinaryData/HDSPack/FileSystem Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,8 @@ Namespace FileSystem
222222 Return intptr
223223 End Function
224224
225+ Dim disposedFlag As Boolean = False
226+
225227 ''' <summary>
226228 ''' write the in-memory content data into
227229 ''' the base file stream, and then update
@@ -251,9 +253,17 @@ Namespace FileSystem
251253 ''' </summary>
252254 ''' <param name="disposing"></param>
253255 Protected Overrides Sub Dispose(disposing As Boolean )
254- writeBuffer()
255- buffer.Dispose()
256- MyBase .Dispose(disposing)
256+ If Not disposedFlag Then
257+ ' avoid unexpected multiple action calls
258+ disposedFlag = True
259+
260+ ' flush current data to file stream
261+ Call writeBuffer()
262+ ' release the memory buffer
263+ Call buffer.Dispose()
264+ ' release base data
265+ Call MyBase .Dispose(disposing)
266+ End If
257267 End Sub
258268 End Class
259269End Namespace
You can’t perform that action at this time.
0 commit comments