Memory leak with the trihedron display.

Hi,

When I set a Z-buffered trihedron in a V3d_View object, memory consumption(pretty huge) of the application grows and grows as the view is rotated, translated, zoomed, etc.
Here's the source code I use to tell a V3d_View object to display a red zbuffered trihedron :
//construct a V3d_View object ...
Handle_V3d_View view = ...;
view->TriedronDisplay (Aspect_TOTP_LEFT_LOWER,
Quantity_NOC_RED, 0.08, V3d_WIREFRAME);

The configuration I use is : OCC 5.2, Windows XP, Visual C++ 6.0 SP5.

Lee Sangsu's picture

Hello,
I also found that problem, and I believe I found a solution too.
I think it is caused by not deleting gldisplaylist used for displaying the triedron.

So, you can solve it by simply inserting one line after the end of using those display list.

try the below one.

in OpenGl_triedron.c

..........
.............

glPopAttrib();

/* fleches au bout des axes (= cones de la couleur demandee) */
l = L - L/4. ; /* distance a l'origine */
rayon = L/30. ; /* rayon de la base du cone */
Angle = 2. * M_PI/ NbFacettes;

glDeleteLists(startList,4);//by LSS for memery leak bug
LightOff();

/*
* origine names
*/
......
......

////////////////////////////////////////////

Sangsu Lee
MIDAS IT

Lee Sangsu's picture

To OCC developers,

I think this code can be improved.
If we make the display lists only when it is made at first or user redefine the triedron, and just call the lists when redrawing, and destroy it in the v3d_viewer's destructor, it would be more fast and efficient.

Currently, it is always recreated and deleted again and it is not so efficient.

Open CASCADE Support Team's picture

Dear Hugues,
Dear Mr. Lee,

Thank you for reporting this problem in Open CASCADE Technology, your deep investigation and correction you suggested!

We are pleased to inform you that the problem you reported has been registered as bug with reference number OCC7726 "Memory leak with the trihedron display".

The correction you suggested will be further processed (tested for non-regression and improved if necessary) and integrated into one of the future releases of OCCT.

Please note that you will be able to track integration of fix on that bug consulting the Release Notes of Open CASCADE Technology. The Release Notes are regularly published on our web site at http://www.opencascade.org/getocc/whatsnew.

Yours cincerely,
Open CASCADE Support Team