Skip to content
  • Fushan Wen's avatar
    powerprofileconfig: Use m_profileCombo as the watcher's parent · 575ae1a1
    Fushan Wen authored
    `m_profileCombo` could be an invalid pointer, because when clicking an
    item, `QAbstractItemView::clicked` and `QAbstractItemView::activated` in
    systemsettings both will be emitted, and `IconMode::changeModule` will be
    called twice, and `closeModules()` will free `m_profileCombo` in the
    second call, which will crash systemsettings.
    
    To fix the crash, set the watcher's parent to `m_profileCombo`, so when
    `m_profileCombo` is destroyed, the watcher is also destroyed and the
    connection is disconnected to prevent modification to the old `m_profileCombo`.
    
    CCBUG: 443858
    
    
    (cherry picked from commit 9b8a9dfd)
    575ae1a1