01-19-2018, 12:24 PM
Hi,
I contacted Ab4d a long while back about binding a PointsCollection to the PositionsList of a MultiPolyLineVisual3D. I believe the following code is what resulted from this discussion. As data is added to the PointsCollection i have in another class ("s" below) I call the following two lines to force an update on the line the view. It appears it is needed to set the PositionsList to a new list (or I believe null also works) and then reassign it to the PointsCollection in question, without the initial reassignment, it does not work.
_multiPolyLineVisual3D.PositionsList = new List<Point3DCollection>();
_multiPolyLineVisual3D.PositionsList = s.PointsCollection;
We are currently testing the software for robustness and are doing many repeated actions which results in the above code being called many times. As this happens there is a constant increase in the number of references to Point3D and Point4D objects i.e. these references are not being released somewhere. If we re-run this test with the above two lines commented out the "leak" goes away. Is there something I am doing wrong or some bug in the MultiPolyLineVisual3D that is causing this?
This leak could well be somewhere else in our code and I will have a look into this also, as yet we have not been able to find anything obvious.
Thanks, TIm
I contacted Ab4d a long while back about binding a PointsCollection to the PositionsList of a MultiPolyLineVisual3D. I believe the following code is what resulted from this discussion. As data is added to the PointsCollection i have in another class ("s" below) I call the following two lines to force an update on the line the view. It appears it is needed to set the PositionsList to a new list (or I believe null also works) and then reassign it to the PointsCollection in question, without the initial reassignment, it does not work.
_multiPolyLineVisual3D.PositionsList = new List<Point3DCollection>();
_multiPolyLineVisual3D.PositionsList = s.PointsCollection;
We are currently testing the software for robustness and are doing many repeated actions which results in the above code being called many times. As this happens there is a constant increase in the number of references to Point3D and Point4D objects i.e. these references are not being released somewhere. If we re-run this test with the above two lines commented out the "leak" goes away. Is there something I am doing wrong or some bug in the MultiPolyLineVisual3D that is causing this?
This leak could well be somewhere else in our code and I will have a look into this also, as yet we have not been able to find anything obvious.
Thanks, TIm

