When i create a file layer, and i duplicate this file layer, the software crashes. Reproducible: Always Steps to Reproduce: 1.Create a new krita file. 2.Open a file in the layers panel 3.Duplicate this file layer. Actual Results: The software crashes. Expected Results: Well, duplicate the file. Krita doesn't want to convert the file layer to a paint layer and all the transform operations that i made to this file layer doesn't worked.
I can reproduce this on my Windows 10 box. Just downloaded the Krita 3.0 build that was generated on July 4, 2016. Created a file layer and tried to duplicate it through the right-click menu.
Here's the backtrace: (gdb) bt #0 0x00007fff940663e0 in ?? () #1 0x00007ffff08afd89 in QMetaObject::cast(QObject*) const () from /home/boud/dev/deps/lib/libQt5Core.so.5 #2 0x00007ffff5a4eb64 in qobject_cast<KoDocumentResourceManager*> (object=<optimized out>) at /home/boud/dev/deps/include/QtCore/qobject.h:518 #3 KoShapeFactoryBase::pruneDocumentResourceManager (this=0x5a42390, obj=<optimized out>) at /home/boud/dev/krita/libs/flake/KoShapeFactoryBase.cpp:255 #4 0x00007ffff08d2a06 in QObject::event(QEvent*) () from /home/boud/dev/deps/lib/libQt5Core.so.5 #5 0x00007ffff17077dc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/boud/dev/deps/lib/libQt5Widgets.so.5 #6 0x00007ffff170bc12 in QApplication::notify(QObject*, QEvent*) () from /home/boud/dev/deps/lib/libQt5Widgets.so.5 #7 0x00007ffff78ea6d7 in KisApplication::notify (this=<optimized out>, receiver=0x5a42390, event=0x7fff9402a5b0) at /home/boud/dev/krita/libs/ui/KisApplication.cpp:505 #8 0x00007ffff08a7955 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/boud/dev/deps/lib/libQt5Core.so.5 #9 0x00007ffff08a973a in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /home/boud/dev/deps/lib/libQt5Core.so.5 #10 0x00007ffff08f8353 in ?? () from /home/boud/dev/deps/lib/libQt5Core.so.5 #11 0x00007fffebd41c84 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0 #12 0x00007fffebd41ed8 in ?? () from /usr/lib64/libglib-2.0.so.0 #13 0x00007fffebd41f7c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0 #14 0x00007ffff08f79dc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/boud/dev/deps/lib/libQt5Core.so.5 #15 0x00007ffff08a5b2b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/boud/dev/deps/lib/libQt5Core.so.5 #16 0x00007ffff08ad886 in QCoreApplication::exec() () from /home/boud/dev/deps/lib/libQt5Core.so.5
There is something very fishy going on here...
Git commit 0f1fc73b2470c329279b76dc4ea6071e6553a1b4 by Boudewijn Rempt. Committed on 05/07/2016 at 12:49. Pushed by rempt into branch 'krita/3.0'. Register KisImageSP as a metatype This avoids the following error when using file layers: Cloning KisFileLayer "/home/boud/Dropbox/pictures/florence_2016/P1010109.JPG" QObject::connect: Cannot queue arguments of type 'KisImageSP' (Make sure 'KisImageSP' is registered using qRegisterMetaType().) Because it allows KisImageSP to be used as an argument in a queued signal/slot connection. M +7 -0 libs/image/kis_image.cc http://commits.kde.org/krita/0f1fc73b2470c329279b76dc4ea6071e6553a1b4
Git commit 9e07c0ab3797500f99eb38cec5736634a2c66781 by Boudewijn Rempt. Committed on 05/07/2016 at 12:49. Pushed by rempt into branch 'krita/3.0'. Store the resource managers in QPointers That way we're save when checking whether they have been deleted. M +12 -10 libs/flake/KoShapeFactoryBase.cpp M +1 -2 libs/flake/KoShapeFactoryBase.h http://commits.kde.org/krita/9e07c0ab3797500f99eb38cec5736634a2c66781
Git commit e719375b09edf3984b3c03c79b627f7187bd2e4b by Boudewijn Rempt. Committed on 05/07/2016 at 12:57. Pushed by rempt into branch 'krita/3.0'. Rename member variable to m_paintDevice We should only be calling KisImage or QImage instances "image", otherwise the scope for confusion is too big. M +11 -10 libs/ui/kis_file_layer.cpp M +2 -2 libs/ui/kis_file_layer.h http://commits.kde.org/krita/e719375b09edf3984b3c03c79b627f7187bd2e4b
Git commit 8acd0ee3d49e41dabcb386e00191dc71c018f9a0 by Boudewijn Rempt. Committed on 05/07/2016 at 13:12. Pushed by rempt into branch 'krita/3.0'. Pass a clone of the paint device instead of the image back to the file layer, because resetting the import document deletes it, which checks whether the image is still in use, and if it is, asserts. M +13 -11 libs/ui/kis_file_layer.cpp M +1 -1 libs/ui/kis_file_layer.h M +4 -1 libs/ui/kis_safe_document_loader.cpp M +1 -1 libs/ui/kis_safe_document_loader.h http://commits.kde.org/krita/8acd0ee3d49e41dabcb386e00191dc71c018f9a0