EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Disposing a storage

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#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 (Team)

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 3855 times

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




|

Back to top

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

Got it!