Rank: Advanced Member
Groups: Member
Joined: 9/10/2010(UTC) Posts: 57
Thanks: 1 times
|
Hello,
When a VObjectCollection contains ImageVObject Instances and one of this ImageVObject Instances is removed from this VObjectCollection, it seems that the Dispose method of this ImageVObject instance is not called, hence the images of BItmap (_image, _drawnImage, _cachedImage) are not disposed.
For example, an ImageVObject instance is removed from MultiLayerViewer.CurrentLayer.VObjects.
If we want to explicitly handle cleaning up of those images of BitMap type of ImageVObject instead of relying on garbage collection, how can we do it?
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 1/31/2005(UTC) Posts: 458
Was thanked: 5 time(s) in 5 post(s)
|
Hello,
Hm, call Dispose() manually? It seems that I don't quite understand you. MultiLayerViewer doesn't call Dispose() for objects inside, because they may be used somewhere in client's code.
If you want to immediately dispose all objects which are removed from workspace - you can use Layer.VObjectRemoved event in Layer class.
Do I answered your question?
|
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 9/10/2010(UTC) Posts: 57
Thanks: 1 times
|
Yes, we want to see whether it is feasible to dispose explicitly an instance of VObject removed from the VObject collection of MulitlLayerViewer.Layer.
we want to see a quick way to take back the memory which the bitMap image of a removed VImageObject in the VObject collection of MultipleLayerViewer.Layer takes. Thus, we may have more flexibilities instead of soley depending on garbage collection merchanism.
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
|
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
![thanks](/Themes/aurigma/heart_small.png) 1 user thanked Dmitry.Obukhov for this useful post.
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.