EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Disposing a storage

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#2364
Posted: 02/23/2007 08:47:25
by Christian Falardeau (Standard support level)
Joined: 02/07/2007
Posts: 17

After many tests ans debugging, I tested the method dispose and it does not nothing. It does not remove the storage from the global static list of storages and it does not close it automatically. Even more, I think the finalizer will never be called because the static list always keeps a strong reference on storages. It should be replaced by using weak reference. There is the WeakReference class in .NET that does that.

Keeping storages in the static list will use extra memory when it is unecessary. If I would open 500 files, there will be 500 storage instance hold in memory even if there are not used.
#2368
Posted: 02/23/2007 10:45:07
by Eugene Mayevski (EldoS Corp.)

Quote
cfalardeau wrote:
I tested the method dispose and it does not nothing. It does not remove the storage from the global static list of storages and it does not close it automatically.


You need to call Close() by hand.
Thanks for the information about WeakReference class, we will update the code.


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 3139 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!