a2f76b15 |
1 | puts "For OCC27871: Possible memory leak in viewers in virtual windows mode" |
2 | puts "For OCC27871: Use 120 kb tolerance for checktrend because of leak on Linux in virtual windows mode" |
3 | puts "============" |
4 | puts "OCC27567" |
5 | puts "============" |
6 | puts "" |
7 | ####################################################################### |
8 | # Visualization - possible memory leaks due to use of plain pointers |
9 | # in IVTK |
10 | ####################################################################### |
11 | |
12 | ivtkinit |
13 | |
14 | dlog off |
15 | # Create i_max number of shapes |
16 | set i_max 15 |
17 | |
18 | set listmem {} |
19 | for {set i 1} {${i} <= ${i_max}} {incr i} { |
20 | |
21 | psphere s 10 15 80 |
22 | box box1 5 5 -5 |
23 | box box2 -5 -5 -5 |
24 | ptorus t 10 3 |
25 | |
26 | compound s box1 box2 t b$i |
27 | |
28 | unset s |
29 | unset box1 |
30 | unset box2 |
31 | unset t |
32 | |
33 | |
34 | # Display the j-th shape |
35 | ivtkdisplay b$i |
36 | |
37 | # Display shaded |
38 | ivtksetdispmode 1 |
39 | |
40 | # Display wired |
41 | ivtksetdispmode 0 |
42 | |
43 | # Select the shape |
44 | ivtkselect 200 200 |
45 | |
46 | # Deselect the shape |
47 | ivtkselect 0 0 |
48 | |
49 | # Highlight the shape |
50 | ivtkmoveto 200 200 |
51 | |
52 | # Unhighlight the shape |
53 | ivtkmoveto 50 50 |
54 | |
55 | # Hide the shape |
56 | ivtkerase b$i |
57 | |
58 | # Remove the shape presentation from memory |
59 | ivtkremove b$i |
60 | |
61 | unset b$i |
62 | |
63 | lappend listmem [meminfo h] |
64 | checktrend $listmem 0 120000 "Memory leak detected" |
65 | } |
66 | |