]> OCCT Git - occt-copy.git/commitdiff
0027871: Possible memory leak in viewers in virtual windows mode CR27871
authorabv <abv@opencascade.com>
Sun, 3 Mar 2019 05:14:43 +0000 (08:14 +0300)
committerabv <abv@opencascade.com>
Sun, 3 Mar 2019 05:14:43 +0000 (08:14 +0300)
Command checktrend is modified to avoid performing check for lists containing less than 5 items, as estimations based on short lists often lead to false positives.

src/DrawResources/TestCommands.tcl
tests/v3d/ivtk/bug27567

index 4d0f849042e516975a9a1ffc5f5153b2b5dfa4d1..1bc84b433080695c4fc59fec81e0d7f9429f405a 100644 (file)
@@ -2731,13 +2731,14 @@ proc _checkpoint {coord_x coord_y rd_ch gr_ch bl_ch} {
 # the check fails and procedure raises error with specified message.
 #
 # Otherwise the procedure returns false meaning that more iterations are needed.
-# Note that false is returned in any case if length of listval is less than 3.
+# Note that analysis is peformed only if listval contains at least 5 values,
+# thus false is returned unconditionally for shorter lists.
 #
 # See example of use to check memory leaks in bugs/caf/bug23489
 #
 proc checktrend {listval delta tolerance message} {
     set nbval [llength $listval]
-    if { $nbval < 3} {
+    if { $nbval < 5} {
         return 0
     }
 
index 5d110ad008d250088d0e126a61a472fa7235764e..bcb5e734c85e1f7969c7a8b83bc8d137980d0292 100644 (file)
@@ -31,7 +31,7 @@ for {set i 1} {${i} <= ${i_max}} {incr i} {
   unset t
   
 
-  # Display the j-th shape
+  # Display the i-th shape
   ivtkdisplay b$i
                
   # Display shaded
@@ -61,6 +61,6 @@ for {set i 1} {${i} <= ${i_max}} {incr i} {
   unset b$i
 
   lappend listmem [meminfo h]
-  checktrend $listmem 0 120000 "Memory leak detected"
+  checktrend $listmem 0 1 "Memory leak detected"
 }