Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
mzhao  
#1 Posted : Thursday, April 28, 2011 11:43:51 AM(UTC)
mzhao

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?
Alex Kon  
#2 Posted : Monday, May 2, 2011 9:57:54 PM(UTC)
Alex Kon

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?

mzhao  
#3 Posted : Tuesday, May 3, 2011 11:06:13 AM(UTC)
mzhao

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.

Dmitry.Obukhov  
#4 Posted : Thursday, May 5, 2011 3:43:56 AM(UTC)
Dmitry.Obukhov

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)
Hello Ming,

Please use Layer.VObjectRemoved event: http://www.aurigma.com/d...ction_VObjectRemoved.htm
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
thanks 1 user thanked Dmitry.Obukhov for this useful post.
mzhao on 5/5/2011(UTC)
Users browsing this topic
Guest
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.