Git commit ac2868ad23b50b5e3196eb0d5d1302f5bb02c741 by Frederik Gladhorn. Committed on 07/11/2016 at 23:42. Pushed by gladhorn into branch 'rempt/impex-refactoring'. Fix bad weak pointer usage The assumption is that weak pointers can become null at any point in time. Only dereference after converting to a strong pointer. M +9 -5 libs/image/brushengine/kis_paintop_settings.cpp M +9 -3 libs/image/commands/kis_deselect_global_selection_command.cpp M +12 -8 libs/image/commands/kis_image_change_layers_command.cpp M +5 -2 libs/image/commands/kis_image_command.cpp M +14 -6 libs/image/commands/kis_image_layer_add_command.cpp M +15 -8 libs/image/commands/kis_image_layer_move_command.cpp M +10 -2 libs/image/commands/kis_image_layer_remove_command.cpp M +28 -8 libs/image/commands/kis_image_layer_remove_command_impl.cpp M +10 -2 libs/image/commands/kis_image_lock_command.cpp M +13 -4 libs/image/commands/kis_image_set_projection_color_space_com= mand.cpp M +8 -2 libs/image/commands/kis_node_property_list_command.cpp M +11 -3 libs/image/commands/kis_reselect_global_selection_command.cpp M +15 -3 libs/image/commands/kis_set_global_selection_command.cpp M +12 -4 libs/image/commands_new/kis_change_projection_color_command.= cpp M +15 -3 libs/image/commands_new/kis_image_resize_command.cpp M +18 -4 libs/image/commands_new/kis_image_set_resolution_command.cpp M +10 -2 libs/image/kis_clone_layer.cpp M +13 -4 libs/image/kis_colorspace_convert_visitor.cpp M +27 -6 libs/image/kis_default_bounds.cpp M +15 -5 libs/image/kis_group_layer.cc M +4 -1 libs/image/kis_histogram.cc M +21 -10 libs/image/kis_image_signal_router.cpp M +11 -3 libs/image/kis_regenerate_frame_stroke_strategy.cpp M +32 -11 libs/image/kis_selection_based_layer.cpp M +9 -4 libs/image/kis_suspend_projection_updates_stroke_strategy.cpp M +2 -5 plugins/extensions/colorspaceconversion/colorspaceconversion= .cc M +5 -3 plugins/extensions/imagesize/imagesize.cc M +8 -3 plugins/extensions/layergroupswitcher/layergroupswitcher.cpp M +16 -14 plugins/extensions/offsetimage/offsetimage.cpp M +3 -4 plugins/extensions/separate_channels/kis_channel_separator.cc M +1 -1 plugins/extensions/separate_channels/kis_separate_channels_p= lugin.cc http://commits.kde.org/krita/ac2868ad23b50b5e3196eb0d5d1302f5bb02c741 diff --git a/libs/image/brushengine/kis_paintop_settings.cpp b/libs/image/b= rushengine/kis_paintop_settings.cpp index b73ba90..8cdb613 100644 --- a/libs/image/brushengine/kis_paintop_settings.cpp +++ b/libs/image/brushengine/kis_paintop_settings.cpp @@ -77,11 +77,13 @@ struct Q_DECL_HIDDEN KisPaintOpSettings::Private { }; = KisPaintopSettingsUpdateProxy* updateProxyNoCreate() const { - return preset ? preset->updateProxyNoCreate() : 0; + auto presetSP =3D preset.toStrongRef(); + return presetSP ? presetSP->updateProxyNoCreate() : 0; } = KisPaintopSettingsUpdateProxy* updateProxyCreate() const { - return preset ? preset->updateProxy() : 0; + auto presetSP =3D preset.toStrongRef(); + return presetSP ? presetSP->updateProxy() : 0; } }; = @@ -379,9 +381,11 @@ void KisPaintOpSettings::setCanvasMirroring(bool xAxis= Mirrored, bool yAxisMirror void KisPaintOpSettings::setProperty(const QString & name, const QVariant = & value) { if (value !=3D KisPropertiesConfiguration::getProperty(name) && - !d->disableDirtyNotifications && this->preset()) { - - this->preset()->setPresetDirty(true); + !d->disableDirtyNotifications) { + KisPaintOpPresetSP presetSP =3D preset().toStrongRef(); + if (presetSP) { + presetSP->setPresetDirty(true); + } } = KisPropertiesConfiguration::setProperty(name, value); diff --git a/libs/image/commands/kis_deselect_global_selection_command.cpp = b/libs/image/commands/kis_deselect_global_selection_command.cpp index 05c9290..919757c 100644 --- a/libs/image/commands/kis_deselect_global_selection_command.cpp +++ b/libs/image/commands/kis_deselect_global_selection_command.cpp @@ -38,11 +38,17 @@ KisDeselectGlobalSelectionCommand::~KisDeselectGlobalSe= lectionCommand() = void KisDeselectGlobalSelectionCommand::redo() { - m_oldSelection =3D m_image->globalSelection(); - m_image->deselectGlobalSelection(); + KisImageSP image =3D m_image.toStrongRef(); + if (image) { + m_oldSelection =3D image->globalSelection(); + image->deselectGlobalSelection(); + } } = void KisDeselectGlobalSelectionCommand::undo() { - m_image->setGlobalSelection(m_oldSelection); + KisImageSP image =3D m_image.toStrongRef(); + if (image) { + image->setGlobalSelection(m_oldSelection); + } } diff --git a/libs/image/commands/kis_image_change_layers_command.cpp b/libs= /image/commands/kis_image_change_layers_command.cpp index 9649f2c..7fe87ee 100644 --- a/libs/image/commands/kis_image_change_layers_command.cpp +++ b/libs/image/commands/kis_image_change_layers_command.cpp @@ -33,16 +33,20 @@ KisImageChangeLayersCommand::KisImageChangeLayersComman= d(KisImageWSP image, KisN = void KisImageChangeLayersCommand::redo() { - m_image->setRootLayer(static_cast(m_newRootLayer.data(= ))); - - m_image->refreshGraphAsync(); - m_image->notifyLayersChanged(); + KisImageSP image =3D m_image.toStrongRef(); + if (image) { + image->setRootLayer(static_cast(m_newRootLayer.dat= a())); + image->refreshGraphAsync(); + image->notifyLayersChanged(); + } } = void KisImageChangeLayersCommand::undo() { - m_image->setRootLayer(static_cast(m_oldRootLayer.data(= ))); - - m_image->refreshGraphAsync(); - m_image->notifyLayersChanged(); + KisImageSP image =3D m_image.toStrongRef(); + if (image) { + image->setRootLayer(static_cast(m_oldRootLayer.dat= a())); + image->refreshGraphAsync(); + image->notifyLayersChanged(); + } } diff --git a/libs/image/commands/kis_image_command.cpp b/libs/image/command= s/kis_image_command.cpp index 8bccab5..f0679bc 100644 --- a/libs/image/commands/kis_image_command.cpp +++ b/libs/image/commands/kis_image_command.cpp @@ -75,7 +75,10 @@ void KisImageCommand::UpdateTarget::update() { if (node) { node->setDirty(m_updateRect); } else { - m_image->refreshGraphAsync(m_removedNodeParent); - m_removedNodeParent->setDirty(m_updateRect); + KisImageSP image =3D m_image.toStrongRef(); + if (image) { + image->refreshGraphAsync(m_removedNodeParent); + m_removedNodeParent->setDirty(m_updateRect); + } } } diff --git a/libs/image/commands/kis_image_layer_add_command.cpp b/libs/ima= ge/commands/kis_image_layer_add_command.cpp index e92280f..95a1443 100644 --- a/libs/image/commands/kis_image_layer_add_command.cpp +++ b/libs/image/commands/kis_image_layer_add_command.cpp @@ -57,24 +57,32 @@ KisImageLayerAddCommand::KisImageLayerAddCommand(KisIma= geWSP image, = void KisImageLayerAddCommand::redo() { + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } if (m_aboveThis || m_index =3D=3D quint32(-1)) { - m_image->addNode(m_layer, m_parent, m_aboveThis); + image->addNode(m_layer, m_parent, m_aboveThis); } else { - m_image->addNode(m_layer, m_parent, m_index); + image->addNode(m_layer, m_parent, m_index); } = if (m_doRedoUpdates) { - m_layer->setDirty(m_image->bounds()); + m_layer->setDirty(image->bounds()); } } = void KisImageLayerAddCommand::undo() { + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } if (m_doUndoUpdates) { - UpdateTarget target(m_image, m_layer, m_image->bounds()); - m_image->removeNode(m_layer); + UpdateTarget target(image, m_layer, image->bounds()); + image->removeNode(m_layer); target.update(); } else { - m_image->removeNode(m_layer); + image->removeNode(m_layer); } } diff --git a/libs/image/commands/kis_image_layer_move_command.cpp b/libs/im= age/commands/kis_image_layer_move_command.cpp index 23f0635..be6d55c 100644 --- a/libs/image/commands/kis_image_layer_move_command.cpp +++ b/libs/image/commands/kis_image_layer_move_command.cpp @@ -61,29 +61,36 @@ KisImageLayerMoveCommand::KisImageLayerMoveCommand(KisI= mageWSP image, KisNodeSP = void KisImageLayerMoveCommand::redo() { - + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } if (m_useIndex) { - m_image->moveNode(m_layer, m_newParent, m_index); + image->moveNode(m_layer, m_newParent, m_index); } else { - m_image->moveNode(m_layer, m_newParent, m_newAbove); + image->moveNode(m_layer, m_newParent, m_newAbove); } = if (m_doUpdates) { - m_image->refreshGraphAsync(m_prevParent); + image->refreshGraphAsync(m_prevParent); if (m_newParent !=3D m_prevParent) { - m_layer->setDirty(m_image->bounds()); + m_layer->setDirty(image->bounds()); } } } = void KisImageLayerMoveCommand::undo() { - m_image->moveNode(m_layer, m_prevParent, m_prevAbove); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + image->moveNode(m_layer, m_prevParent, m_prevAbove); = if (m_doUpdates) { - m_image->refreshGraphAsync(m_newParent); + image->refreshGraphAsync(m_newParent); if (m_newParent !=3D m_prevParent) { - m_layer->setDirty(m_image->bounds()); + m_layer->setDirty(image->bounds()); } } } diff --git a/libs/image/commands/kis_image_layer_remove_command.cpp b/libs/= image/commands/kis_image_layer_remove_command.cpp index 8e62748..6217e1f 100644 --- a/libs/image/commands/kis_image_layer_remove_command.cpp +++ b/libs/image/commands/kis_image_layer_remove_command.cpp @@ -58,7 +58,11 @@ void KisImageLayerRemoveCommand::addSubtree(KisImageWSP = image, KisNodeSP node) = void KisImageLayerRemoveCommand::redo() { - UpdateTarget target(m_image, m_node, m_image->bounds()); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + UpdateTarget target(image, m_node, image->bounds()); KisImageCommand::redo(); = if (m_doRedoUpdates) { @@ -75,6 +79,10 @@ void KisImageLayerRemoveCommand::undo() * We are removing the group recursively, so the updates should * come recursively as well */ - m_image->refreshGraphAsync(m_node, m_image->bounds()); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + image->refreshGraphAsync(m_node, image->bounds()); } } diff --git a/libs/image/commands/kis_image_layer_remove_command_impl.cpp b/= libs/image/commands/kis_image_layer_remove_command_impl.cpp index bdbce86..124afa8 100644 --- a/libs/image/commands/kis_image_layer_remove_command_impl.cpp +++ b/libs/image/commands/kis_image_layer_remove_command_impl.cpp @@ -59,28 +59,39 @@ KisImageLayerRemoveCommandImpl::~KisImageLayerRemoveCom= mandImpl() = void KisImageLayerRemoveCommandImpl::redo() { + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } m_d->processClones(m_d->node); - m_image->removeNode(m_d->node); + image->removeNode(m_d->node); } = void KisImageLayerRemoveCommandImpl::undo() { - m_image->addNode(m_d->node, m_d->prevParent, m_d->prevAbove); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + image->addNode(m_d->node, m_d->prevParent, m_d->prevAbove); m_d->restoreClones(); } = void KisImageLayerRemoveCommandImpl::Private::restoreClones() { Q_ASSERT(reincarnatedNodes.size() =3D=3D clonesList.size()); - + KisImageSP image =3D q->m_image.toStrongRef(); + if (!image) { + return; + } for (int i =3D 0; i < reincarnatedNodes.size(); i++) { KisCloneLayerSP clone =3D clonesList[i]; KisLayerSP newNode =3D reincarnatedNodes[i]; = - q->m_image->addNode(clone, newNode->parent(), newNode); + image->addNode(clone, newNode->parent(), newNode); moveChildren(newNode, clone); moveClones(newNode, clone); - q->m_image->removeNode(newNode); + image->removeNode(newNode); } } = @@ -102,6 +113,11 @@ void KisImageLayerRemoveCommandImpl::Private::processC= lones(KisNodeSP node) } } = + KisImageSP image =3D q->m_image.toStrongRef(); + if (!image) { + return; + } + /** * Move the children and transitive clones to the * reincarnated nodes @@ -110,18 +126,22 @@ void KisImageLayerRemoveCommandImpl::Private::process= Clones(KisNodeSP node) KisCloneLayerSP clone =3D clonesList[i]; KisLayerSP newNode =3D reincarnatedNodes[i]; = - q->m_image->addNode(newNode, clone->parent(), clone); + image->addNode(newNode, clone->parent(), clone); moveChildren(clone, newNode); moveClones(clone, newNode); - q->m_image->removeNode(clone); + image->removeNode(clone); } } = void KisImageLayerRemoveCommandImpl::Private::moveChildren(KisNodeSP src, = KisNodeSP dst) { + KisImageSP image =3D q->m_image.toStrongRef(); + if (!image) { + return; + } KisNodeSP child =3D src->firstChild(); while(child) { - q->m_image->moveNode(child, dst, dst->lastChild()); + image->moveNode(child, dst, dst->lastChild()); child =3D child->nextSibling(); } } diff --git a/libs/image/commands/kis_image_lock_command.cpp b/libs/image/co= mmands/kis_image_lock_command.cpp index 7a6bc52..c743aeb 100644 --- a/libs/image/commands/kis_image_lock_command.cpp +++ b/libs/image/commands/kis_image_lock_command.cpp @@ -31,11 +31,19 @@ KisImageLockCommand::KisImageLockCommand(KisImageWSP im= age, bool lockImage) = void KisImageLockCommand::redo() { - m_image->refreshGraph(); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + image->refreshGraph(); } = void KisImageLockCommand::undo() { - m_image->refreshGraph(); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + image->refreshGraph(); } = diff --git a/libs/image/commands/kis_image_set_projection_color_space_comma= nd.cpp b/libs/image/commands/kis_image_set_projection_color_space_command.c= pp index fbf2922..e4d2a32 100644 --- a/libs/image/commands/kis_image_set_projection_color_space_command.cpp +++ b/libs/image/commands/kis_image_set_projection_color_space_command.cpp @@ -28,16 +28,25 @@ KisImageSetProjectionColorSpaceCommand::KisImageSetProjectionColorSpaceCom= mand(KisImageWSP image, const KoColorSpace * afterColorSpace) : KisImageCommand(kundo2_i18n("Convert Image Type"), image) { - m_beforeColorSpace =3D image->colorSpace(); - m_afterColorSpace =3D afterColorSpace; + KisImageSP imageSP =3D image.toStrongRef(); + if (imageSP) { + m_beforeColorSpace =3D imageSP->colorSpace(); + m_afterColorSpace =3D afterColorSpace; + } } = void KisImageSetProjectionColorSpaceCommand::redo() { - m_image->setProjectionColorSpace(m_afterColorSpace); + KisImageSP image =3D m_image.toStrongRef(); + if (image) { + image->setProjectionColorSpace(m_afterColorSpace); + } } = void KisImageSetProjectionColorSpaceCommand::undo() { - m_image->setProjectionColorSpace(m_beforeColorSpace); + KisImageSP image =3D m_image.toStrongRef(); + if (image) { + image->setProjectionColorSpace(m_beforeColorSpace); + } } diff --git a/libs/image/commands/kis_node_property_list_command.cpp b/libs/= image/commands/kis_node_property_list_command.cpp index fe87e2b..070df07 100644 --- a/libs/image/commands/kis_node_property_list_command.cpp +++ b/libs/image/commands/kis_node_property_list_command.cpp @@ -71,10 +71,16 @@ void KisNodePropertyListCommand::doUpdate(const KisBase= Node::PropertyList &oldPr = if (oldPassThroughValue && !newPassThroughValue) { KisLayerSP layer(qobject_cast(m_node.data())); - layer->image()->refreshGraphAsync(layer); + KisImageSP image =3D layer->image().toStrongRef(); + if (image) { + image->refreshGraphAsync(layer); + } } else if (m_node->parent() && !oldPassThroughValue && newPassThroughV= alue) { KisLayerSP layer(qobject_cast(m_node->parent().data())); - layer->image()->refreshGraphAsync(layer); + KisImageSP image =3D layer->image().toStrongRef(); + if (image) { + image->refreshGraphAsync(layer); + } } else { m_node->setDirty(); // TODO check if visibility was changed or not } diff --git a/libs/image/commands/kis_reselect_global_selection_command.cpp = b/libs/image/commands/kis_reselect_global_selection_command.cpp index c38dc26..9012c38 100644 --- a/libs/image/commands/kis_reselect_global_selection_command.cpp +++ b/libs/image/commands/kis_reselect_global_selection_command.cpp @@ -38,17 +38,25 @@ KisReselectGlobalSelectionCommand::~KisReselectGlobalSe= lectionCommand() = void KisReselectGlobalSelectionCommand::redo() { - m_canReselect =3D m_image->canReselectGlobalSelection(); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + m_canReselect =3D image->canReselectGlobalSelection(); = if (m_canReselect) { - m_image->reselectGlobalSelection(); + image->reselectGlobalSelection(); } } = void KisReselectGlobalSelectionCommand::undo() { + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } if (m_canReselect) { - m_image->deselectGlobalSelection(); + image->deselectGlobalSelection(); } } = diff --git a/libs/image/commands/kis_set_global_selection_command.cpp b/lib= s/image/commands/kis_set_global_selection_command.cpp index d01b0cd..681c317 100644 --- a/libs/image/commands/kis_set_global_selection_command.cpp +++ b/libs/image/commands/kis_set_global_selection_command.cpp @@ -29,18 +29,30 @@ KisSetGlobalSelectionCommand::KisSetGlobalSelectionCommand(KisImageWSP ima= ge, KisSelectionSP selection) : m_image(image) { - m_oldSelection =3D m_image->globalSelection(); + KisImageSP imageSP =3D m_image.toStrongRef(); + if (!image) { + return; + } + m_oldSelection =3D imageSP->globalSelection(); m_newSelection =3D selection; } = void KisSetGlobalSelectionCommand::redo() { - m_image->setGlobalSelection(m_newSelection); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + image->setGlobalSelection(m_newSelection); } = void KisSetGlobalSelectionCommand::undo() { - m_image->setGlobalSelection(m_oldSelection); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + image->setGlobalSelection(m_oldSelection); } = KisSetEmptyGlobalSelectionCommand::KisSetEmptyGlobalSelectionCommand(KisIm= ageWSP image) diff --git a/libs/image/commands_new/kis_change_projection_color_command.cp= p b/libs/image/commands_new/kis_change_projection_color_command.cpp index 9e0d433..5d4c0d8 100644 --- a/libs/image/commands_new/kis_change_projection_color_command.cpp +++ b/libs/image/commands_new/kis_change_projection_color_command.cpp @@ -59,12 +59,20 @@ bool KisChangeProjectionColorCommand::mergeWith(const K= Undo2Command* command) = void KisChangeProjectionColorCommand::redo() { - m_image->setDefaultProjectionColor(m_newColor); - m_image->animationInterface()->setDefaultProjectionColor(m_newColor); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + image->setDefaultProjectionColor(m_newColor); + image->animationInterface()->setDefaultProjectionColor(m_newColor); } = void KisChangeProjectionColorCommand::undo() { - m_image->setDefaultProjectionColor(m_oldColor); - m_image->animationInterface()->setDefaultProjectionColor(m_oldColor); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + image->setDefaultProjectionColor(m_oldColor); + image->animationInterface()->setDefaultProjectionColor(m_oldColor); } diff --git a/libs/image/commands_new/kis_image_resize_command.cpp b/libs/im= age/commands_new/kis_image_resize_command.cpp index d7971f5..86f5350 100644 --- a/libs/image/commands_new/kis_image_resize_command.cpp +++ b/libs/image/commands_new/kis_image_resize_command.cpp @@ -29,16 +29,28 @@ KisImageResizeCommand::KisImageResizeCommand(KisImageWS= P image, m_image(image) { // do we really need a translatable name for the command? - m_sizeBefore =3D image->size(); + KisImageSP imageSP =3D m_image.toStrongRef(); + if (!imageSP) { + return; + } + m_sizeBefore =3D imageSP->size(); m_sizeAfter =3D newSize; } = void KisImageResizeCommand::redo() { - m_image->setSize(m_sizeAfter); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + image->setSize(m_sizeAfter); } = void KisImageResizeCommand::undo() { - m_image->setSize(m_sizeBefore); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + image->setSize(m_sizeBefore); } diff --git a/libs/image/commands_new/kis_image_set_resolution_command.cpp b= /libs/image/commands_new/kis_image_set_resolution_command.cpp index 2a8a9fc..4136ceb 100644 --- a/libs/image/commands_new/kis_image_set_resolution_command.cpp +++ b/libs/image/commands_new/kis_image_set_resolution_command.cpp @@ -27,19 +27,33 @@ KisImageSetResolutionCommand::KisImageSetResolutionComm= and(KisImageWSP image, qr , m_image(image) , m_newXRes(newXRes) , m_newYRes(newYRes) - , m_oldXRes(m_image->xRes()) - , m_oldYRes(m_image->yRes()) + , m_oldXRes(0) + , m_oldYRes(0) { + KisImageSP imageSP =3D image.toStrongRef(); + if (!imageSP) { + return; + } + m_oldXRes =3D imageSP->xRes(); + m_oldYRes =3D imageSP->yRes(); } = void KisImageSetResolutionCommand::undo() { - m_image->setResolution(m_oldXRes, m_oldYRes); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + image->setResolution(m_oldXRes, m_oldYRes); } = void KisImageSetResolutionCommand::redo() { - m_image->setResolution(m_newXRes, m_newYRes); + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + image->setResolution(m_newXRes, m_newYRes); } = = diff --git a/libs/image/kis_clone_layer.cpp b/libs/image/kis_clone_layer.cpp index 54172ea..c3def95e 100644 --- a/libs/image/kis_clone_layer.cpp +++ b/libs/image/kis_clone_layer.cpp @@ -59,7 +59,11 @@ KisCloneLayer::KisCloneLayer(KisLayerSP from, KisImageWS= P image, const QString & : KisLayer(image, name, opacity) , m_d(new Private(new KisDefaultBounds(image))) { - m_d->fallback =3D new KisPaintDevice(image->colorSpace()); + KisImageSP imageSP =3D image.toStrongRef(); + if (!imageSP) { + return; + } + m_d->fallback =3D new KisPaintDevice(imageSP->colorSpace()); m_d->copyFrom =3D from; m_d->type =3D COPY_PROJECTION; = @@ -164,7 +168,11 @@ void KisCloneLayer::setDirtyOriginal(const QRect &rect) = void KisCloneLayer::notifyParentVisibilityChanged(bool value) { - KisLayer::setDirty(image()->bounds()); + KisImageSP imageSP =3D image().toStrongRef(); + if (!imageSP) { + return; + } + KisLayer::setDirty(imageSP->bounds()); KisLayer::notifyParentVisibilityChanged(value); } = diff --git a/libs/image/kis_colorspace_convert_visitor.cpp b/libs/image/kis= _colorspace_convert_visitor.cpp index 36e323d..40dca99 100644 --- a/libs/image/kis_colorspace_convert_visitor.cpp +++ b/libs/image/kis_colorspace_convert_visitor.cpp @@ -112,24 +112,29 @@ bool KisColorSpaceConvertVisitor::convertPaintDevice(= KisLayer* layer) } } = + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return false; + } + if (layer->original()) { KUndo2Command* cmd =3D layer->original()->convertTo(m_dstColorSpac= e, m_renderingIntent, m_conversionFlags); if (cmd) { - m_image->undoAdapter()->addCommand(cmd); + image->undoAdapter()->addCommand(cmd); } } = if (layer->paintDevice()) { KUndo2Command* cmd =3D layer->paintDevice()->convertTo(m_dstColorS= pace, m_renderingIntent, m_conversionFlags); if (cmd) { - m_image->undoAdapter()->addCommand(cmd); + image->undoAdapter()->addCommand(cmd); } } = if (layer->projection()) { KUndo2Command* cmd =3D layer->projection()->convertTo(m_dstColorSp= ace, m_renderingIntent, m_conversionFlags); if (cmd) { - m_image->undoAdapter()->addCommand(cmd); + image->undoAdapter()->addCommand(cmd); } } = @@ -146,9 +151,13 @@ bool KisColorSpaceConvertVisitor::convertPaintDevice(K= isLayer* layer) = bool KisColorSpaceConvertVisitor::visit(KisColorizeMask *mask) { + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return false; + } KUndo2Command* cmd =3D mask->setColorSpace(m_dstColorSpace, m_renderin= gIntent, m_conversionFlags); if (cmd) { - m_image->undoAdapter()->addCommand(cmd); + image->undoAdapter()->addCommand(cmd); } return true; } diff --git a/libs/image/kis_default_bounds.cpp b/libs/image/kis_default_bou= nds.cpp index 98b849b..42028d9 100644 --- a/libs/image/kis_default_bounds.cpp +++ b/libs/image/kis_default_bounds.cpp @@ -55,28 +55,48 @@ QRect KisDefaultBounds::bounds() const /** * By default return infinite rect to cover everything */ - return m_d->image ? m_d->image->effectiveLodBounds() : infiniteRect; + KisImageSP image =3D m_d->image.toStrongRef(); + if (!image) { + return infiniteRect; + } + return image->effectiveLodBounds(); } = bool KisDefaultBounds::wrapAroundMode() const { - return m_d->image ? m_d->image->wrapAroundModeActive() : false; + KisImageSP image =3D m_d->image.toStrongRef(); + if (!image) { + return false; + } + return image->wrapAroundModeActive(); } = int KisDefaultBounds::currentLevelOfDetail() const { - return m_d->image ? m_d->image->currentLevelOfDetail() : 0; + KisImageSP image =3D m_d->image.toStrongRef(); + if (!image) { + return 0; + } + return image->currentLevelOfDetail(); } = int KisDefaultBounds::currentTime() const { - KisImageAnimationInterface *interface =3D m_d->image ? m_d->image->ani= mationInterface() : 0; + KisImageSP image =3D m_d->image.toStrongRef(); + if (!image) { + return 0; + } + KisImageAnimationInterface *interface =3D image->animationInterface(); return interface ? interface->currentTime() : 0; } = bool KisDefaultBounds::externalFrameActive() const { - KisImageAnimationInterface *interface =3D m_d->image ? m_d->image->ani= mationInterface() : 0; + KisImageSP image =3D m_d->image.toStrongRef(); + if (!image) { + return 0; + } + KisImageAnimationInterface *interface =3D image->animationInterface(); return interface ? interface->externalFrameActive() : false; } = @@ -103,7 +123,8 @@ KisSelectionDefaultBounds::~KisSelectionDefaultBounds() = QRect KisSelectionDefaultBounds::bounds() const { - QRect additionalRect =3D m_d->parentDevice ? m_d->parentDevice->extent= () : QRect(); + auto parentDevice =3D m_d->parentDevice.toStrongRef(); + QRect additionalRect =3D parentDevice ? parentDevice->extent() : QRect= (); return additionalRect | KisDefaultBounds::bounds(); } = diff --git a/libs/image/kis_group_layer.cc b/libs/image/kis_group_layer.cc index 3567ade..4480b88 100644 --- a/libs/image/kis_group_layer.cc +++ b/libs/image/kis_group_layer.cc @@ -144,8 +144,13 @@ void KisGroupLayer::setImage(KisImageWSP image) = KisLayerSP KisGroupLayer::createMergedLayerTemplate(KisLayerSP prevLayer) { - KisGroupLayer *prevGroup =3D dynamic_cast(prevLayer.da= ta()); + KisImageSP imageSP =3D image().toStrongRef(); + if (!imageSP) { + warnImage << "image invalid"; + return KisLayerSP(); + } = + KisGroupLayer *prevGroup =3D dynamic_cast(prevLayer.da= ta()); if (prevGroup && canMergeAndKeepBlendOptions(prevLayer)) { KisSharedPtr merged(new KisGroupLayer(*prevGroup)); = @@ -153,14 +158,15 @@ KisLayerSP KisGroupLayer::createMergedLayerTemplate(K= isLayerSP prevLayer) = for (child =3D firstChild(); child; child =3D child->nextSibling()= ) { cloned =3D child->clone(); - image()->addNode(cloned, merged); + imageSP->addNode(cloned, merged); } = - image()->refreshGraphAsync(merged); + imageSP->refreshGraphAsync(merged); = return merged; - } else + } else { return KisLayer::createMergedLayerTemplate(prevLayer); + } } = void KisGroupLayer::fillMergedLayerTemplate(KisLayerSP dstLayer, KisLayerS= P prevLayer) @@ -172,8 +178,12 @@ void KisGroupLayer::fillMergedLayerTemplate(KisLayerSP= dstLayer, KisLayerSP prev = void KisGroupLayer::resetCache(const KoColorSpace *colorSpace) { + KisImageSP imageSP =3D image().toStrongRef(); + if (!imageSP) { + return; + } if (!colorSpace) - colorSpace =3D image()->colorSpace(); + colorSpace =3D imageSP->colorSpace(); = Q_ASSERT(colorSpace); = diff --git a/libs/image/kis_histogram.cc b/libs/image/kis_histogram.cc index 787f112..3e6dbcd 100644 --- a/libs/image/kis_histogram.cc +++ b/libs/image/kis_histogram.cc @@ -35,7 +35,10 @@ KisHistogram::KisHistogram(const KisPaintLayerSP layer, { Q_ASSERT(producer); = - m_bounds =3D layer->image()->bounds(); + KisImageSP imageSP =3D layer->image().toStrongRef(); + if (imageSP) { + m_bounds =3D imageSP->bounds(); + } m_type =3D type; m_producer =3D producer; m_selection =3D false; diff --git a/libs/image/kis_image_signal_router.cpp b/libs/image/kis_image_= signal_router.cpp index 4f44093..b2a857a 100644 --- a/libs/image/kis_image_signal_router.cpp +++ b/libs/image/kis_image_signal_router.cpp @@ -89,7 +89,10 @@ void KisImageSignalRouter::emitNodeHasBeenAdded(KisNode = *parent, int index) KisNodeSP newNode =3D parent->at(index); = if (!newNode->inherits("KisSelectionMask")) { - m_image->invalidateAllFrames(); + KisImageSP image =3D m_image.toStrongRef(); + if (image) { + image->invalidateAllFrames(); + } } = emit sigNodeAddedAsync(newNode); @@ -100,7 +103,10 @@ void KisImageSignalRouter::emitAboutToRemoveANode(KisN= ode *parent, int index) KisNodeSP removedNode =3D parent->at(index); = if (!removedNode->inherits("KisSelectionMask")) { - m_image->invalidateAllFrames(); + KisImageSP image =3D m_image.toStrongRef(); + if (image) { + image->invalidateAllFrames(); + } } = emit sigRemoveNodeAsync(removedNode); @@ -109,30 +115,35 @@ void KisImageSignalRouter::emitAboutToRemoveANode(Kis= Node *parent, int index) = void KisImageSignalRouter::slotNotification(KisImageSignalType type) { + KisImageSP image =3D m_image.toStrongRef(); + if (!image) { + return; + } + switch(type.id) { case LayersChangedSignal: - m_image->invalidateAllFrames(); + image->invalidateAllFrames(); emit sigLayersChangedAsync(); break; case ModifiedSignal: emit sigImageModified(); break; case SizeChangedSignal: - m_image->invalidateAllFrames(); + image->invalidateAllFrames(); emit sigSizeChanged(type.sizeChangedSignal.oldStillPoint, type.sizeChangedSignal.newStillPoint); break; case ProfileChangedSignal: - m_image->invalidateAllFrames(); - emit sigProfileChanged(m_image->profile()); + image->invalidateAllFrames(); + emit sigProfileChanged(image->profile()); break; case ColorSpaceChangedSignal: - m_image->invalidateAllFrames(); - emit sigColorSpaceChanged(m_image->colorSpace()); + image->invalidateAllFrames(); + emit sigColorSpaceChanged(image->colorSpace()); break; case ResolutionChangedSignal: - m_image->invalidateAllFrames(); - emit sigResolutionChanged(m_image->xRes(), m_image->yRes()); + image->invalidateAllFrames(); + emit sigResolutionChanged(image->xRes(), image->yRes()); break; case NodeReselectionRequestSignal: if (type.nodeReselectionSignal.newActiveNode || diff --git a/libs/image/kis_regenerate_frame_stroke_strategy.cpp b/libs/ima= ge/kis_regenerate_frame_stroke_strategy.cpp index 329e76a..b0d1929 100644 --- a/libs/image/kis_regenerate_frame_stroke_strategy.cpp +++ b/libs/image/kis_regenerate_frame_stroke_strategy.cpp @@ -57,12 +57,20 @@ struct KisRegenerateFrameStrokeStrategy::Private }; = void saveAndResetUpdatesFilter() { - prevUpdatesFilter =3D interface->image()->projectionUpdatesFilter(= ); - interface->image()->setProjectionUpdatesFilter(KisProjectionUpdate= sFilterSP()); + KisImageSP image =3D interface->image().toStrongRef(); + if (!image) { + return; + } + prevUpdatesFilter =3D image->projectionUpdatesFilter(); + image->setProjectionUpdatesFilter(KisProjectionUpdatesFilterSP()); } = void restoreUpdatesFilter() { - interface->image()->setProjectionUpdatesFilter(prevUpdatesFilter); + KisImageSP image =3D interface->image().toStrongRef(); + if (!image) { + return; + } + image->setProjectionUpdatesFilter(prevUpdatesFilter); prevUpdatesFilter.clear(); } }; diff --git a/libs/image/kis_selection_based_layer.cpp b/libs/image/kis_sele= ction_based_layer.cpp index 623eb7b..09daf22 100644 --- a/libs/image/kis_selection_based_layer.cpp +++ b/libs/image/kis_selection_based_layer.cpp @@ -62,9 +62,12 @@ KisSelectionBasedLayer::KisSelectionBasedLayer(KisImageW= SP image, initSelection(); else setInternalSelection(selection); - - m_d->paintDevice =3D KisPaintDeviceSP(new KisPaintDevice(this, image->= colorSpace(), KisDefaultBoundsSP(new KisDefaultBounds(image)))); - connect(image.data(), SIGNAL(sigSizeChanged(QPointF,QPointF)), SLOT(sl= otImageSizeChanged())); + KisImageSP imageSP =3D image.toStrongRef(); + if (!imageSP) { + return; + } + m_d->paintDevice =3D KisPaintDeviceSP(new KisPaintDevice(this, imageSP= ->colorSpace(), KisDefaultBoundsSP(new KisDefaultBounds(image)))); + connect(imageSP.data(), SIGNAL(sigSizeChanged(QPointF,QPointF)), SLOT(= slotImageSizeChanged())); } = KisSelectionBasedLayer::KisSelectionBasedLayer(const KisSelectionBasedLaye= r& rhs) @@ -191,8 +194,12 @@ QRect KisSelectionBasedLayer::needRect(const QRect &re= ct, PositionToFilthy pos) = void KisSelectionBasedLayer::resetCache(const KoColorSpace *colorSpace) { + KisImageSP imageSP =3D image().toStrongRef(); + if (!imageSP) { + return; + } if (!colorSpace) - colorSpace =3D image()->colorSpace(); + colorSpace =3D imageSP->colorSpace(); = if (!m_d->paintDevice || *m_d->paintDevice->colorSpace() !=3D *colorSpace) { @@ -218,11 +225,15 @@ void KisSelectionBasedLayer::setInternalSelection(Kis= SelectionSP selection) m_d->selection =3D 0; } = - if (selection->pixelSelection()->defaultBounds()->bounds() !=3D image(= )->bounds()) { + KisImageSP imageSP =3D image().toStrongRef(); + if (!imageSP) { + return; + } + if (selection->pixelSelection()->defaultBounds()->bounds() !=3D imageS= P->bounds()) { qWarning() << "WARNING: KisSelectionBasedLayer::setInternalSelecti= on" << "New selection has suspicious default bounds"; qWarning() << "WARNING:" << ppVar(selection->pixelSelection()->def= aultBounds()->bounds()); - qWarning() << "WARNING:" << ppVar(image()->bounds()); + qWarning() << "WARNING:" << ppVar(imageSP->bounds()); } } = @@ -269,24 +280,34 @@ KisKeyframeChannel *KisSelectionBasedLayer::requestKe= yframeChannel(const QString void KisSelectionBasedLayer::setDirty() { Q_ASSERT(image()); - - setDirty(image()->bounds()); + KisImageSP imageSP =3D image().toStrongRef(); + if (!imageSP) { + return; + } + setDirty(imageSP->bounds()); } = QRect KisSelectionBasedLayer::extent() const { Q_ASSERT(image()); - + KisImageSP imageSP =3D image().toStrongRef(); + if (!imageSP) { + return QRect(); + } return m_d->selection ? - m_d->selection->selectedRect() : image()->bounds(); + m_d->selection->selectedRect() : imageSP->bounds(); } = QRect KisSelectionBasedLayer::exactBounds() const { Q_ASSERT(image()); + KisImageSP imageSP =3D image().toStrongRef(); + if (!imageSP) { + return QRect(); + } = return m_d->selection ? - m_d->selection->selectedExactRect() : image()->bounds(); + m_d->selection->selectedExactRect() : imageSP->bounds(); } = QImage KisSelectionBasedLayer::createThumbnail(qint32 w, qint32 h) diff --git a/libs/image/kis_suspend_projection_updates_stroke_strategy.cpp = b/libs/image/kis_suspend_projection_updates_stroke_strategy.cpp index 0a944d4..94f7034 100644 --- a/libs/image/kis_suspend_projection_updates_stroke_strategy.cpp +++ b/libs/image/kis_suspend_projection_updates_stroke_strategy.cpp @@ -211,16 +211,21 @@ void KisSuspendProjectionUpdatesStrokeStrategy::doStr= okeCallback(KisStrokeJobDat Private::UpdatesBarrierData *barrierData =3D dynamic_cast(data); Private::IssueCanvasUpdatesData *canvasUpdates =3D dynamic_cast(data); = + KisImageSP image =3D m_d->image.toStrongRef(); + if (!image) { + return; + } + if (suspendData) { - m_d->image->setProjectionUpdatesFilter( + image->setProjectionUpdatesFilter( KisProjectionUpdatesFilterSP(new Private::SuspendLod0Updates()= )); } else if (resumeData) { - m_d->image->disableUIUpdates(); + image->disableUIUpdates(); resumeAndIssueUpdates(false); } else if (barrierData) { - m_d->image->enableUIUpdates(); + image->enableUIUpdates(); } else if (canvasUpdates) { - m_d->image->notifyProjectionUpdated(canvasUpdates->updateRect); + image->notifyProjectionUpdated(canvasUpdates->updateRect); } } = diff --git a/plugins/extensions/colorspaceconversion/colorspaceconversion.c= c b/plugins/extensions/colorspaceconversion/colorspaceconversion.cc index 81367b8..dcfd109 100644 --- a/plugins/extensions/colorspaceconversion/colorspaceconversion.cc +++ b/plugins/extensions/colorspaceconversion/colorspaceconversion.cc @@ -68,11 +68,9 @@ ColorSpaceConversion::~ColorSpaceConversion() = void ColorSpaceConversion::slotImageColorSpaceConversion() { - KisImageWSP image =3D m_view->image(); - + KisImageSP image =3D m_view->image().toStrongRef(); if (!image) return; = - DlgColorSpaceConversion * dlgColorSpaceConversion =3D new DlgColorSpac= eConversion(m_view->mainWindow(), "ColorSpaceConversion"); bool allowLCMSOptimization =3D KisConfig().allowLCMSOptimization(); dlgColorSpaceConversion->m_page->chkAllowLCMSOptimization->setChecked(= allowLCMSOptimization); @@ -98,8 +96,7 @@ void ColorSpaceConversion::slotImageColorSpaceConversion() = void ColorSpaceConversion::slotLayerColorSpaceConversion() { - - KisImageWSP image =3D m_view->image(); + KisImageSP image =3D m_view->image().toStrongRef(); if (!image) return; = KisLayerSP layer =3D m_view->activeLayer(); diff --git a/plugins/extensions/imagesize/imagesize.cc b/plugins/extensions= /imagesize/imagesize.cc index 3734ee6..ca21339 100644 --- a/plugins/extensions/imagesize/imagesize.cc +++ b/plugins/extensions/imagesize/imagesize.cc @@ -67,8 +67,7 @@ ImageSize::~ImageSize() = void ImageSize::slotImageSize() { - KisImageWSP image =3D m_view->image(); - + KisImageSP image =3D m_view->image().toStrongRef(); if (!image) return; = DlgImageSize * dlgImageSize =3D new DlgImageSize(m_view->mainWindow(),= image->width(), image->height(), image->yRes()); @@ -133,7 +132,10 @@ void ImageSize::slotLayerSize() = void ImageSize::slotSelectionScale() { - KisImageWSP image =3D m_view->image(); + KisImageSP image =3D m_view->image(); + if (!image) { + return; + } KisLayerSP layer =3D m_view->activeLayer(); = KIS_ASSERT_RECOVER_RETURN(image && layer); diff --git a/plugins/extensions/layergroupswitcher/layergroupswitcher.cpp b= /plugins/extensions/layergroupswitcher/layergroupswitcher.cpp index 7b988fa..6a31698 100644 --- a/plugins/extensions/layergroupswitcher/layergroupswitcher.cpp +++ b/plugins/extensions/layergroupswitcher/layergroupswitcher.cpp @@ -47,7 +47,6 @@ LayerGroupSwitcher::LayerGroupSwitcher(QObject *parent, c= onst QVariantList &) action =3D new KisAction(i18n("Move into next group"), this); addAction("LayerGroupSwitcher/next", action); connect(action, SIGNAL(triggered()), this, SLOT(moveIntoNextGroup())); - } = LayerGroupSwitcher::~LayerGroupSwitcher() @@ -56,7 +55,10 @@ LayerGroupSwitcher::~LayerGroupSwitcher() = void LayerGroupSwitcher::moveIntoNextGroup() { - KisImageWSP image =3D m_view->image(); + KisImageSP image =3D m_view->image().toStrongRef(); + if (!image) { + return; + } KisNodeManager *nodeManager =3D m_view->nodeManager(); KisLayerSP active =3D nodeManager->activeLayer(); if (!active) { @@ -94,7 +96,10 @@ void LayerGroupSwitcher::moveIntoNextGroup() = void LayerGroupSwitcher::moveIntoPreviousGroup() { - KisImageWSP image =3D m_view->image(); + KisImageSP image =3D m_view->image().toStrongRef(); + if (!image) { + return; + } KisNodeManager *nodeManager =3D m_view->nodeManager(); KisLayerSP active =3D nodeManager->activeLayer(); if (!active) { diff --git a/plugins/extensions/offsetimage/offsetimage.cpp b/plugins/exten= sions/offsetimage/offsetimage.cpp index c62d5fa..8bc975b 100644 --- a/plugins/extensions/offsetimage/offsetimage.cpp +++ b/plugins/extensions/offsetimage/offsetimage.cpp @@ -59,7 +59,7 @@ OffsetImage::~OffsetImage() = void OffsetImage::slotOffsetImage() { - KisImageWSP image =3D m_view->image(); + KisImageSP image =3D m_view->image().toStrongRef(); if (image) { = DlgOffsetImage * dlgOffsetImage =3D new DlgOffsetImage(m_view->mai= nWindow(), "OffsetImage", offsetWrapRect().size()); @@ -83,22 +83,21 @@ void OffsetImage::slotOffsetImage() = void OffsetImage::slotOffsetLayer() { - KisImageWSP image =3D m_view->image(); + KisImageSP image =3D m_view->image().toStrongRef(); if (image) { = - DlgOffsetImage * dlgOffsetImage =3D new DlgOffsetImage(m_view->mainWin= dow(), "OffsetLayer", offsetWrapRect().size()); - Q_CHECK_PTR(dlgOffsetImage); - - KUndo2MagicString actionName =3D kundo2_i18n("Offset Layer"); - dlgOffsetImage->setCaption(i18nc("@title:window", "Offset Layer")); + DlgOffsetImage * dlgOffsetImage =3D new DlgOffsetImage(m_view->mai= nWindow(), "OffsetLayer", offsetWrapRect().size()); + Q_CHECK_PTR(dlgOffsetImage); = - if (dlgOffsetImage->exec() =3D=3D QDialog::Accepted) { - QPoint offsetPoint =3D QPoint(dlgOffsetImage->offsetX(), dlgOffset= Image->offsetY()); - KisNodeSP activeNode =3D m_view->activeNode(); - offsetImpl(actionName, activeNode, offsetPoint); - } - delete dlgOffsetImage; + KUndo2MagicString actionName =3D kundo2_i18n("Offset Layer"); + dlgOffsetImage->setCaption(i18nc("@title:window", "Offset Layer")); = + if (dlgOffsetImage->exec() =3D=3D QDialog::Accepted) { + QPoint offsetPoint =3D QPoint(dlgOffsetImage->offsetX(), dlgOf= fsetImage->offsetY()); + KisNodeSP activeNode =3D m_view->activeNode(); + offsetImpl(actionName, activeNode, offsetPoint); + } + delete dlgOffsetImage; } else { @@ -131,7 +130,10 @@ QRect OffsetImage::offsetWrapRect() } else { - offsetWrapRect =3D m_view->image()->bounds(); + KisImageSP image =3D m_view->image().toStrongRef(); + if (image) { + offsetWrapRect =3D image->bounds(); + } } return offsetWrapRect; } diff --git a/plugins/extensions/separate_channels/kis_channel_separator.cc = b/plugins/extensions/separate_channels/kis_channel_separator.cc index 436286e..0748064 100644 --- a/plugins/extensions/separate_channels/kis_channel_separator.cc +++ b/plugins/extensions/separate_channels/kis_channel_separator.cc @@ -66,7 +66,7 @@ KisChannelSeparator::KisChannelSeparator(KisViewManager *= view) = void KisChannelSeparator::separate(KoUpdater * progressUpdater, enumSepAlp= haOptions alphaOps, enumSepSource sourceOps, enumSepOutput outputOps, bool = downscale, bool toColor) { - KisImageWSP image =3D m_view->image(); + KisImageSP image =3D m_view->image(); if (!image) return; = KisPaintDeviceSP src; @@ -100,7 +100,7 @@ void KisChannelSeparator::separate(KoUpdater * progress= Updater, enumSepAlphaOpti = QRect rect =3D src->exactBounds(); = - m_view->image()->lock(); + image->lock(); int i =3D 0; for (QList::const_iterator it =3D begin; it !=3D end;= ++it) { = @@ -267,8 +267,7 @@ void KisChannelSeparator::separate(KoUpdater * progress= Updater, enumSepAlphaOpti if (outputOps =3D=3D TO_LAYERS) { undo->endMacro(); } - m_view->image()->unlock(); + image->unlock(); image->setModified(); } - } diff --git a/plugins/extensions/separate_channels/kis_separate_channels_plu= gin.cc b/plugins/extensions/separate_channels/kis_separate_channels_plugin.= cc index 16713b2..e09d46b 100644 --- a/plugins/extensions/separate_channels/kis_separate_channels_plugin.cc +++ b/plugins/extensions/separate_channels/kis_separate_channels_plugin.cc @@ -58,7 +58,7 @@ KisSeparateChannelsPlugin::~KisSeparateChannelsPlugin() = void KisSeparateChannelsPlugin::slotSeparate() { - KisImageWSP image =3D m_view->image(); + KisImageSP image =3D m_view->image(); if (!image) return; = KisLayerSP l =3D m_view->nodeManager()->activeLayer();