Skip to content
  • Aaron J. Seigo's avatar
    use a QWeakPointer on the KIconLoader passed in as there are no lifetime guarantees · a8d16682
    Aaron J. Seigo authored
    usually KGlobal::iconLoader() is used, so this isn't an issue seen very often.
    however, when a local KIconLoader is created, it is easy to get QIcons with a
    KIconEngine that has a bad KIconLoader pointer in them. particularly as QIcon
    is implicitly shared and easily passed around. the StatusNotifier Plasma DataEngine
    was triggering this, though it would be trivial to run into this problem again
    anytime a KIconLoader is created locally
    
    thankfully, QWeakPointer does the job and is very fast and light. (confirmed
    both with my own testing and confirmation from Thiago).
    
    massive thanks to Michael Pyne for detecting the cause of the problem via Valgrind.
    
    BUG:258706
    a8d16682