Commit | Line | Data |
---|---|---|
c7a422d8 | 1 | puts "TODO ?OCC24156 MacOS: Tcl Exception: File Bottom.brep could not be found" |
2 | puts "TODO ?OCC24156 MacOS: TEST INCOMPLETE" | |
3cdfdc9a | 3 | |
deb26df7 RL |
4 | # Test for #23489: memory leak in TNaming_NamedShape destructor |
5 | ||
6 | pload OCAF | |
7 | ||
351bbcba | 8 | # take some big file to be loaded |
9 | set file [locate_data_file Bottom.brep] | |
10 | ||
deb26df7 RL |
11 | set listmem {} |
12 | for {set i 1} {$i < 10} {incr i} { | |
13 | # load big shape | |
351bbcba | 14 | restore $file a |
deb26df7 RL |
15 | |
16 | # add shape to new OCAF document | |
17 | NewDocument D MDTV-Standard | |
18 | ||
19 | # add shape to document | |
20 | SetShape D 0:1 a | |
21 | ||
22 | # Note: if ForgetAll or Undo is called here, memory is correctly freed! | |
23 | # ForgetAll D 0:1 | |
24 | ||
25 | # close document | |
26 | Close D | |
24de79c3 | 27 | |
deb26df7 RL |
28 | |
29 | # unload shape (replace by small one) | |
30 | vertex a 0 0 0 | |
31 | ||
32 | # check memory usage (with tolerance equal to half page size) | |
67a1064e | 33 | lappend listmem [meminfo h] |
deb26df7 RL |
34 | if { [checktrend $listmem 0 256 "Memory leak detected"] } { |
35 | puts "No memory leak, $i iterations" | |
36 | break | |
37 | } | |
38 | } |