<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>392178</bug_id>
          
          <creation_ts>2018-03-22 14:09:48 +0000</creation_ts>
          <short_desc>Krita crashes when deleting palette</short_desc>
          <delta_ts>2018-05-03 09:39:35 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>Resource Management</component>
          <version>4.0</version>
          <rep_platform>Appimage</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Livio Fania">fanialivio</reporter>
          <assigned_to name="Halla Rempt">halla</assigned_to>
          <cc>halla</cc>
    
    <cc>lautay20</cc>
    
    <cc>takiro-kde</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1739736</commentid>
    <comment_count>0</comment_count>
    <who name="Livio Fania">fanialivio</who>
    <bug_when>2018-03-22 14:09:48 +0000</bug_when>
    <thetext>Krita crashes every time I click on the garbage bin icon to delete a color palette. I&apos;m using the appimage of the 4.0 version released today in Ubuntu 17.10.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1739755</commentid>
    <comment_count>1</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2018-03-22 14:41:17 +0000</bug_when>
    <thetext>I can confirm:

Thread 1 (Thread 0x7fe007ddd940 (LWP 4219)):
[KCrash Handler]
#6  0x00007fe004bb469e in QScopedPointer&lt;KoColorSet::Private, QScopedPointerDeleter&lt;KoColorSet::Private&gt; &gt;::operator-&gt;() const (this=0x20) at /usr/include/qt5/QtCore/qscopedpointer.h:118
#7  0x00007fe004bb469e in KoColorSet::nColors() (this=0x0) at /home/boud/dev/krita/libs/pigment/resources/KoColorSet.cpp:283
#8  0x00007fe0076c83da in KisPaletteModel::indexFromId(int) const (this=0xc2dae40, i=i@entry=-1) at /home/boud/dev/krita/libs/ui/KisPaletteModel.cpp:275
#9  0x00007fdfce4dde7e in PaletteDockerDock::setColorFromNameList(int) (this=0xc2c6aa0, index=-1) at /home/boud/dev/krita/plugins/dockers/palettedocker/palettedocker_dock.cpp:233
#10 0x00007fdfce4e3f4b in PaletteDockerDock::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0xc2c6aa0, _c=&lt;optimized out&gt;, _id=&lt;optimized out&gt;, _a=&lt;optimized out&gt;) at /home/boud/dev/b-krita/plugins/dockers/palettedocker/moc_palettedocker_dock.cpp:109
#11 0x00007fdffd2235ef in QMetaObject::activate(QObject*, int, int, void**) (sender=sender@entry=0xc2d2b40, signalOffset=&lt;optimized out&gt;, local_signal_index=local_signal_index@entry=5, argv=argv@entry=0x7ffc182c2250) at kernel/qobject.cpp:3766
#12 0x00007fdffd2241e7 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0xc2d2b40, m=m@entry=0x7fdffe7d7d60 &lt;QComboBox::staticMetaObject&gt;, local_signal_index=local_signal_index@entry=5, argv=argv@entry=0x7ffc182c2250) at kernel/qobject.cpp:3628
#13 0x00007fdffe21e2f1 in QComboBox::currentIndexChanged(int) (this=this@entry=0xc2d2b40, _t1=-1) at .moc/moc_qcombobox.cpp:503
#14 0x00007fdffe21ff21 in QComboBoxPrivate::_q_emitCurrentIndexChanged(QModelIndex const&amp;) (this=this@entry=0xc2d2b90, index=...) at widgets/qcombobox.cpp:1374
#15 0x00007fdffe224568 in QComboBoxPrivate::_q_rowsRemoved(QModelIndex const&amp;, int, int) (this=0xc2d2b90, parent=...) at widgets/qcombobox.cpp:1136
#16 0x00007fdffe226fd9 in QComboBox::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=&lt;optimized out&gt;, _c=&lt;optimized out&gt;, _id=&lt;optimized out&gt;, _a=0x7ffc182c24c0) at .moc/moc_qcombobox.cpp:294
#17 0x00007fdffd2235ef in QMetaObject::activate(QObject*, int, int, void**) (sender=sender@entry=0xc2d2ed0, signalOffset=&lt;optimized out&gt;, local_signal_index=local_signal_index@entry=12, argv=argv@entry=0x7ffc182c24c0) at kernel/qobject.cpp:3766
#18 0x00007fdffd2241e7 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0xc2d2ed0, m=m@entry=0x7fdffd652920 &lt;QAbstractItemModel::staticMetaObject&gt;, local_signal_index=local_signal_index@entry=12, argv=argv@entry=0x7ffc182c24c0) at kernel/qobject.cpp:3628
#19 0x00007fdffd1a2dfe in QAbstractItemModel::rowsRemoved(QModelIndex const&amp;, int, int, QAbstractItemModel::QPrivateSignal) (this=this@entry=0xc2d2ed0, _t1=..., _t2=0, _t3=767, _t4=_t4@entry=...) at .moc/moc_qabstractitemmodel.cpp:616
#20 0x00007fdffd1aa3aa in QAbstractItemModel::endRemoveRows() (this=0xc2d2ed0) at itemmodels/qabstractitemmodel.cpp:2763
#21 0x00007fdffdaabe47 in QStandardItemModelPrivate::rowsRemoved(QStandardItem*, int, int) (this=&lt;optimized out&gt;, parent=parent@entry=0xc2d2fc0, row=row@entry=0, count=count@entry=768) at itemmodels/qstandarditemmodel.cpp:589
#22 0x00007fdffdaac069 in QStandardItem::removeRows(int, int) (this=this@entry=0xc2d2fc0, row=row@entry=0, count=count@entry=768) at itemmodels/qstandarditemmodel.cpp:1687
#23 0x00007fdffdaac154 in QStandardItemModel::removeRows(int, int, QModelIndex const&amp;) (this=&lt;optimized out&gt;, row=row@entry=0, count=768, parent=...) at itemmodels/qstandarditemmodel.cpp:2867
#24 0x00007fdffe2219f6 in QComboBox::clear() (this=0xc2d2b40) at widgets/qcombobox.cpp:2929
#25 0x00007fdfce4de134 in PaletteDockerDock::setColorSet(KoColorSet*) (this=0xc2c6aa0, colorSet=0x0) at /home/boud/dev/krita/plugins/dockers/palettedocker/palettedocker_dock.cpp:180
#26 0x00007fe0076d19cc in KoResourceServer&lt;KoColorSet, PointerStoragePolicy&lt;KoColorSet&gt; &gt;::notifyRemovingResource(KoColorSet*) (resource=0x2d91f90, this=0x3654810) at /home/boud/dev/krita/libs/widgets/KoResourceServer.h:611
#27 0x00007fe0076d19cc in KoResourceServer&lt;KoColorSet, PointerStoragePolicy&lt;KoColorSet&gt; &gt;::removeResourceAndBlacklist(KoColorSet*) (resource=0x2d91f90, this=0x3654810) at /home/boud/dev/krita/libs/widgets/KoResourceServer.h:336
#28 0x00007fe0076d19cc in KoResourceServerAdapter&lt;KoColorSet, PointerStoragePolicy&lt;KoColorSet&gt; &gt;::removeResource(KoResource*) (this=&lt;optimized out&gt;, resource=&lt;optimized out&gt;) at /home/boud/dev/krita/libs/widgets/KoResourceServerAdapter.h:179
#29 0x00007fe0057cc9bf in KoResourceItemChooser::slotButtonClicked(int) (this=0xc2e3690, button=&lt;optimized out&gt;) at /home/boud/dev/krita/libs/widgets/KoResourceItemChooser.cpp:221
#30 0x00007fdffd2235ef in QMetaObject::activate(QObject*, int, int, void**) (sender=0xc2f2e50, signalOffset=&lt;optimized out&gt;, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffc182c2ac0) at kernel/qobject.cpp:3766
#31 0x00007fdffd2241e7 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=&lt;optimized out&gt;, m=m@entry=0x7fdffe7d5b80 &lt;QButtonGroup::staticMetaObject&gt;, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffc182c2ac0) at kernel/qobject.cpp:3628
#32 0x00007fdffe211bf1 in QButtonGroup::buttonClicked(int) (this=&lt;optimized out&gt;, _t1=1) at .moc/moc_qbuttongroup.cpp:250
#33 0x00007fdffe20d9cc in QAbstractButtonPrivate::emitClicked() (this=0xc2f3b10) at widgets/qabstractbutton.cpp:417
#34 0x00007fdffe20ee93 in QAbstractButtonPrivate::click() (this=0xc2f3b10) at widgets/qabstractbutton.cpp:407
#35 0x00007fdffe20f005 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) (this=0xc2f3ad0, e=0x7ffc182c3010) at widgets/qabstractbutton.cpp:1011
#36 0x00007fdffe159657 in QWidget::event(QEvent*) (this=0xc2f3ad0, event=0x7ffc182c3010) at kernel/qwidget.cpp:8817
#37 0x00007fdffe11d7fc in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=&lt;optimized out&gt;, receiver=0xc2f3ad0, e=0x7ffc182c3010) at kernel/qapplication.cpp:3733
#38 0x00007fdffe124c7c in QApplication::notify(QObject*, QEvent*) (this=&lt;optimized out&gt;, receiver=receiver@entry=0xc2f3ad0, e=e@entry=0x7ffc182c3010) at kernel/qapplication.cpp:3209
#39 0x00007fe00762fa67 in KisApplication::notify(QObject*, QEvent*) (this=&lt;optimized out&gt;, receiver=0xc2f3ad0, event=0x7ffc182c3010) at /home/boud/dev/krita/libs/ui/KisApplication.cpp:620
#40 0x00007fdffd1f9325 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=receiver@entry=0xc2f3ad0, event=event@entry=0x7ffc182c3010) at kernel/qcoreapplication.cpp:1044
#41 0x00007fdffe123af9 in QCoreApplication::sendEvent(QObject*, QEvent*) (event=&lt;optimized out&gt;, receiver=&lt;optimized out&gt;) at ../../src/corelib/kernel/qcoreapplication.h:234
#42 0x00007fdffe123af9 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&lt;QWidget&gt;&amp;, bool) (receiver=receiver@entry=0xc2f3ad0, event=event@entry=0x7ffc182c3010, alienWidget=alienWidget@entry=0xc2f3ad0, nativeWidget=0xc305ce0, buttonDown=buttonDown@entry=0x7fdffe801860 &lt;qt_button_down&gt;, lastMouseReceiver=..., spontaneous=spontaneous@entry=true) at kernel/qapplication.cpp:2712
#43 0x00007fdffe171884 in QWidgetWindow::handleMouseEvent(QMouseEvent*) (this=this@entry=0xc5cc480, event=event@entry=0x7ffc182c34d0) at kernel/qwidgetwindow.cpp:548
#44 0x00007fdffe174063 in QWidgetWindow::event(QEvent*) (this=0xc5cc480, event=0x7ffc182c34d0) at kernel/qwidgetwindow.cpp:273
#45 0x00007fdffe11d7fc in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=&lt;optimized out&gt;, receiver=0xc5cc480, e=0x7ffc182c34d0) at kernel/qapplication.cpp:3733
#46 0x00007fdffe1245e0 in QApplication::notify(QObject*, QEvent*) (this=0x7ffc182c3bf0, receiver=receiver@entry=0xc5cc480, e=e@entry=0x7ffc182c34d0) at kernel/qapplication.cpp:3492
#47 0x00007fe00762fa67 in KisApplication::notify(QObject*, QEvent*) (this=&lt;optimized out&gt;, receiver=0xc5cc480, event=0x7ffc182c34d0) at /home/boud/dev/krita/libs/ui/KisApplication.cpp:620
#48 0x00007fdffd1f9325 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=receiver@entry=0xc5cc480, event=event@entry=0x7ffc182c34d0) at kernel/qcoreapplication.cpp:1044
#49 0x00007fdffd76eb0d in QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) (event=0x7ffc182c34d0, receiver=0xc5cc480) at ../../src/corelib/kernel/qcoreapplication.h:237
#50 0x00007fdffd76eb0d in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) (e=0xc60a710) at kernel/qguiapplication.cpp:1957
#51 0x00007fdffd7706c5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) (e=e@entry=0xc60a710) at kernel/qguiapplication.cpp:1741
#52 0x00007fdffd74e71b in QWindowSystemInterface::sendWindowSystemEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) (flags=...) at kernel/qwindowsysteminterface.cpp:976
#53 0x00007fdff13dc47b in QPAEventDispatcherGlib::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) (this=0x2365780, flags=...) at qeventdispatcher_glib.cpp:70
#54 0x00007fdffd1f7a4b in QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) (this=this@entry=0x7ffc182c3710, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#55 0x00007fdffd200104 in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1332
#56 0x00007fdffd766e5c in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1687
#57 0x00007fdffe11d755 in QApplication::exec() () at kernel/qapplication.cpp:2918
#58 0x0000000000405745 in main(int, char**) (argc=1, argv=&lt;optimized out&gt;) at /home/boud/dev/krita/krita/main.cc:361</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1741328</commentid>
    <comment_count>2</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2018-03-28 14:09:40 +0000</bug_when>
    <thetext>*** Bug 392212 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1742801</commentid>
    <comment_count>3</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2018-04-03 09:15:19 +0000</bug_when>
    <thetext>Git commit fa38e733feeb3d156e9bb32a9dfe59c9332e9028 by Boudewijn Rempt.
Committed on 03/04/2018 at 09:03.
Pushed by rempt into branch &apos;master&apos;.

Check pointer before dereferencing

M  +8    -6    libs/ui/KisPaletteModel.cpp

https://commits.kde.org/krita/fa38e733feeb3d156e9bb32a9dfe59c9332e9028</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1742854</commentid>
    <comment_count>4</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2018-04-03 11:47:23 +0000</bug_when>
    <thetext>Git commit 1530629b303a0073be323163454be299f4b64eb0 by Boudewijn Rempt.
Committed on 03/04/2018 at 11:21.
Pushed by rempt into branch &apos;krita/4.0&apos;.

Check pointer before dereferencing
(cherry picked from commit fa38e733feeb3d156e9bb32a9dfe59c9332e9028)

M  +8    -6    libs/ui/KisPaletteModel.cpp

https://commits.kde.org/krita/1530629b303a0073be323163454be299f4b64eb0</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>