1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

...

1 Commits

Author SHA1 Message Date
abv
baa6e38e70 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.
2019-03-03 08:14:43 +03:00
2 changed files with 5 additions and 4 deletions

View 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
}

View 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"
}