[VNET 0004270]: Memoryleak in FindRange

Thomas Flemming tf at ttqv.com
Sun May 24 04:48:27 CDT 2009


Hi,

I'm using Dispose now:

resultSet = fldCat.FindRange(False, 0, e.max_cat, True)
If resultSet IsNot Nothing Then
     resultSet = fldSize.FindRange(True, e.min_size, 9999999, False, resultSet)
End If
If resultSet IsNot Nothing Then
     resultSet = fldEN.FindRange(False, e.south, 90 * di, False, resultSet)
End If
If resultSet IsNot Nothing Then
     resultSet = fldES.FindRange(False, -90 * di, e.north, False, resultSet)
End If
If resultSet IsNot Nothing Then
     resultSet = fldEW.FindRange(False, -180 * di, e.east, False, resultSet)
End If
If resultSet IsNot Nothing Then
     resultSet = fldEE.FindRange(False, e.west, 180 * di, False, resultSet)
End If
If resultSet IsNot Nothing Then
     c = CType(resultSet, IVSet).Count
     ctotal += c
     'resultIter = CType(resultSet, IVSet).MakeNewIterator
     'mTblObjects.RecID = resultIter.FirstItem
     'mTblObjectsData.RecID = resultIter.FirstItem

     resultSet.Dispose()

End If

This does not free the used memory, or am I using it wrong?

Tom




Ivan Smahin schrieb:
> Hello Ruslan,
> 
> Sunday, May 24, 2009, 12:33:34 PM, you wrote:
> 
>> On 5/24/09 12:31 PM, "Thomas Flemming" <tf at ttqv.com> wrote:
> 
>> Hi Thomas,
> 
>>> I just tried the 4.2b7, but the memoryleak-bug is still in.
>>> Please guys, I'm somehow stucked without this fix... ;-)
> 
>> Actually b7 should contains fix
> 
>> Ivan?
> 
>> May be more leaks present ??
> 
> 
> It is copied from http://www.valentina-db.com/bt/view.php?id=4270
> (28.04.2009)
> 
> 1. There is unmanaged resource under IVBitSet object.
> So it should be freed (explicitly calling IVBitSet::Dispose() method) by you.
> 
> It should be something like:
> 
> resultSet = fldCat.FindRange(False, 0, e.max_cat, True)
> ... do something with resultSet ...
> resultSet.Dispose()
> 
> 2. vSet::Dispose() contained a bug. It is fixed now.
> 
> 
> 

-- 
/****************************************
**   Dipl.-Ing. Thomas Flemming
**   Software Development
**
**   Touratech AG
**   Auf dem Zimmermann 7-9
**   D-78078 Niedereschach
**
**   mail  tf at ttqv.com
**   fon   +49 (0) 7728 9279-206
**   fax   +49 (0) 7728 9279-29
**
**   http://www.ttqv.com
**   http://www.touratech.de
**
**   ... und immer dem Pfeil nach!
***************************************/


More information about the Valentina mailing list