Commit 9c0b6591 authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Fix crash when canceling applying a filter

Ref T2217
parent 006eb79f
......@@ -54,6 +54,9 @@ public:
virtual void refreshGraphAsync(KisNodeSP root = 0) = 0;
virtual void refreshGraphAsync(KisNodeSP root, const QRect &rc) = 0;
virtual void refreshGraphAsync(KisNodeSP root, const QRect &rc, const QRect &cropRect) = 0;
virtual void setProjectionUpdatesFilter(KisProjectionUpdatesFilterSP filter) = 0;
virtual KisProjectionUpdatesFilterSP projectionUpdatesFilter() const = 0;
};
class KRITAIMAGE_EXPORT KisProjectionUpdateListener
......
......@@ -166,7 +166,17 @@ void KisFilterStrokeStrategy::cancelStrokeCallback()
delete m_d->secondaryTransaction;
m_d->filterDevice = 0;
KisProjectionUpdatesFilterSP prevUpdatesFilter;
if (m_d->cancelSilently) {
/**
* TODO: Projection updates filter is not recursive, please
* redesign this part
*/
prevUpdatesFilter = m_d->updatesFacade->projectionUpdatesFilter();
if (prevUpdatesFilter) {
m_d->updatesFacade->setProjectionUpdatesFilter(KisProjectionUpdatesFilterSP());
}
m_d->updatesFacade->disableDirtyRequests();
}
......@@ -174,6 +184,10 @@ void KisFilterStrokeStrategy::cancelStrokeCallback()
if (m_d->cancelSilently) {
m_d->updatesFacade->enableDirtyRequests();
if (prevUpdatesFilter) {
m_d->updatesFacade->setProjectionUpdatesFilter(prevUpdatesFilter);
prevUpdatesFilter.clear();
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment