On Vie, 31 de Diciembre de 2004, 15:45, Joerg Heinicke dijo:
> On 31.12.2004 18:46, Antonio Gallardo wrote:
>
>>>> while (iter.hasNext()) {
>>>>- Source child = null;
>>>>- try {
>>>>- status = remove((Source) iter.next());
>>>>- if (status != STATUS_OK) {
>>>>- return status;
>>>>- }
>>>>- }
>>>>- finally {
>>>>- if (child != null) {
>>>>- m_resolver.release(child);
>>>
>>>------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>
>>>
>>>>- }
>>>>+ status = remove((Source) iter.next());
>>>>+ if (status != STATUS_OK) {
>>>>+ return status;
>>>> }
>>>> }
>>>> }
>>>
>>>What about releasing the Source's??
>>
>>
>> 'child' is always = null. The condition never happen to be true. Then it
>> is unnecesary code.
>
> Ah, yes, from the code it does not behave differently than before. But I
> guess it has been buggy before too. It should probably read:
>
> while (iter.hasNext()) {
> Source child = null;
> try {
> child = (Source) iter.next();
> status = remove(child);
> if (status != STATUS_OK) {
> return status;
> }
> } finally {
> if (child != null) {
> m_resolver.release(child);
> }
> }
> }
>
> This was what I had in mind when claiming about the missing release of
> the sources. Maybe somebody else (the original author?) can review it.
Yep. I hope the original author or someone with more knowledge of this
class can give us his opinion. I was just cleaning the code ;-)
Best Regards,
Antonio Gallardo
>
> Joerg
>