Re-sorting FBL_ArraySet?
Ruslan Zasukhin
sunshine at public.kherson.ua
Tue Dec 2 00:19:24 CST 2003
on 12/2/03 12:09 AM, Arthur Clemens at aclemens at xs4all.nl wrote:
>> But you check mShownSet pointer.
>>
>> C++ language has the next trap
>>
>>
>> p1 = some object
>> p2 = p1
>>
>> delete p1;
>> p1 = NULL;
>>
>>
>> p2 still is not NULL !!!
>>
>> so if you try code as
>>
>> if( p2 )
>> delete p2; // CRASH!
>>
>
> Hmm, that is pretty basic. My C++ is not so fresh anymore (well was
> it?).
> Removing the 'delete mShownSet' made it work.
But I think it is still not so simple.
May happens that SOMETIMES you must delete.
For example, you MUST delete mShownSet if you DID NOT send it to Sort.
I think you need do something as:
selection = obj.GetMeShownSet()
{
tmp = mShownSet;
mShownSet = NULL;
return tmp;
}
You must call this when you going send selection to Sort().
So your second object already NOT point to this selection.
After sort you assign new selection.
> Thanks for the help.
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list