From baa6e38e7050d06423105e1d21a902fbfb538530 Mon Sep 17 00:00:00 2001 From: abv Date: Sun, 3 Mar 2019 08:14:43 +0300 Subject: [PATCH] 0027871: Possible memory leak in viewers in virtual windows mode 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 | 5 +++-- tests/v3d/ivtk/bug27567 | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/DrawResources/TestCommands.tcl b/src/DrawResources/TestCommands.tcl index 4d0f849042..1bc84b4330 100644 --- a/src/DrawResources/TestCommands.tcl +++ b/src/DrawResources/TestCommands.tcl @@ -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 } diff --git a/tests/v3d/ivtk/bug27567 b/tests/v3d/ivtk/bug27567 index 5d110ad008..bcb5e734c8 100644 --- a/tests/v3d/ivtk/bug27567 +++ b/tests/v3d/ivtk/bug27567 @@ -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" } -- 2.39.5