I am building a front end for a large, multi user database, where it
is possible that different parts of the program will require access
to objects representing the same physical data.
Each block of data will be represented by a class object by my
framework, so I'd like to instantiate only one object and pass it
byref to the parts of the program that will be working with it.
This is easy enough, as each block has a unique signature, so I've
set up a dictionary to store the single instance keyed against that
data blocks unique id.
The trouble is, once the data block object is no longer referenced by
the program, it does not get cleaned up because the main lookup
dictionary still contains a reference to it.
Therefore I'd like to embed a timer in each class object that removes
it from the dictionary once it's reference count = 1.
Can this be done, or is there a better way to manage this situation?
It wouldn't be an issue for a couple of hundred data objects, but his
could well spiral into the hundreds of thousands of unique data
objects, and I'd really like to dispose of them from memory once I've
finished with them.
- Tom
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>