[VNET 0004270]: Memoryleak in FindRange
Ivan Smahin
ivan_smahin at paradigmasoft.com
Sun May 24 04:56:25 CDT 2009
Hello Thomas,
Sunday, May 24, 2009, 12:48:27 PM, you wrote:
> 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
resultSet points to some unmanaged recourse here.
> If resultSet IsNot Nothing Then
> resultSet = fldEN.FindRange(False, e.south, 90 * di, False, resultSet)
> End If
Here is ANOTHER resultSet object which points to another unmanaged
recourse.
> 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
So where do you call 'dispose' for all that objects?
I see only one call for last object.
> 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.
>>
>>
>>
--
Best regards,
Ivan Smahin
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com
More information about the Valentina
mailing list