extragear/multimedia/amarok/src/collection/sqlcollection

Mark Kretschmann kretschmann at kde.org
Mon Jun 8 14:28:59 CEST 2009


On Mon, Jun 8, 2009 at 1:10 PM, Jeff Mitchell <mitchell at kde.org> wrote:
> Mark Kretschmann wrote:
>> SVN commit 978819 by markey:
>>
>> Don't crash when starting a collection scan after a previous scan had
>> been aborted.
>>
>> We destroyed the ScanManager instance when aborting the scan,
>> and then never instantiated it again, ending up with a 0-pointer dereference.
>> Now we reinstantiate the ScanManager automatically.
>>
>> This seems the safest way to fix this issue for now. I pondered
>> refactoring the code to keep the ScanManager always alive, but this
>> would require major changes and seemed too risky at this point.
>
> This seems like a drastic fix.
>
> Why not just call ScanManager::slotError if the scan is aborted?  This
> is probably what aborting the scan should have done anyways, and as far
> as I can tell it will properly reset the scan manager for next time
> (since that's the point of the function).

I tried several other approaches, but in the end they all had side
effects and didn't work out. The solution I ended up with was the
least drastic after all, with no side effects.

If you can get your proposal to work, all the better. I'll be happy
with whatever works :)

-- 
Mark Kretschmann
Amarok Developer
www.kde.org - amarok.kde.org


More information about the Amarok-devel mailing list