mirror of https://github.com/aseprite/aseprite.git
Fix crash painting deleted cels while applying filter (fix #4991)
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run
Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run
Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run
Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run
Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run
Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run
Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run
Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run
Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run
Details
build-auto / build-auto (Debug, macos-latest) (push) Has been cancelled
Details
build-auto / build-auto (Debug, ubuntu-latest) (push) Has been cancelled
Details
build-auto / build-auto (Debug, windows-latest) (push) Has been cancelled
Details
build-auto / build-auto (RelWithDebInfo, macos-latest) (push) Has been cancelled
Details
build-auto / build-auto (RelWithDebInfo, ubuntu-latest) (push) Has been cancelled
Details
build-auto / build-auto (RelWithDebInfo, windows-latest) (push) Has been cancelled
Details
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run
Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run
Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run
Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run
Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run
Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run
Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run
Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run
Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run
Details
build-auto / build-auto (Debug, macos-latest) (push) Has been cancelled
Details
build-auto / build-auto (Debug, ubuntu-latest) (push) Has been cancelled
Details
build-auto / build-auto (Debug, windows-latest) (push) Has been cancelled
Details
build-auto / build-auto (RelWithDebInfo, macos-latest) (push) Has been cancelled
Details
build-auto / build-auto (RelWithDebInfo, ubuntu-latest) (push) Has been cancelled
Details
build-auto / build-auto (RelWithDebInfo, windows-latest) (push) Has been cancelled
Details
This could happen in the Editor::onPaint() or Timeline::onPaint().
This commit is contained in:
parent
f26ce64208
commit
d7b2faca6d
2
laf
2
laf
|
@ -1 +1 @@
|
|||
Subproject commit de781a5066732d700ac4520ee5fc9034e92875ad
|
||||
Subproject commit 39706c11063fb53cf4c8e865102c6f71e2606906
|
|
@ -325,10 +325,15 @@ void FilterManagerImpl::applyToTarget()
|
|||
void FilterManagerImpl::initTransaction()
|
||||
{
|
||||
ASSERT(!m_tx);
|
||||
m_writer.reset(new ContextWriter(m_reader));
|
||||
m_writer = std::make_unique<ContextWriter>(m_reader);
|
||||
m_tx.reset(new Tx(*m_writer, m_filter->getName(), ModifyDocument));
|
||||
}
|
||||
|
||||
void FilterManagerImpl::updateWriterThread()
|
||||
{
|
||||
document()->updateWriterThread();
|
||||
}
|
||||
|
||||
bool FilterManagerImpl::isTransaction() const
|
||||
{
|
||||
return (m_tx != nullptr);
|
||||
|
|
|
@ -93,6 +93,7 @@ public:
|
|||
void applyToTarget();
|
||||
|
||||
void initTransaction();
|
||||
void updateWriterThread();
|
||||
bool isTransaction() const;
|
||||
void commitTransaction();
|
||||
|
||||
|
|
|
@ -118,7 +118,13 @@ FilterWorker::~FilterWorker()
|
|||
|
||||
void FilterWorker::run()
|
||||
{
|
||||
// Initialize writting transaction
|
||||
// Initialize writing transaction from the main thread. This is
|
||||
// required to get the activeSite() from the UIContext from
|
||||
// CmdTransaction::calcSpritePosition().
|
||||
//
|
||||
// The document will keep the UI thread associated as the "writer"
|
||||
// thread, but that will be updated later in
|
||||
// applyFilterInBackground() with the worker thread ID.
|
||||
m_filterMgr->initTransaction();
|
||||
|
||||
std::thread thread;
|
||||
|
@ -182,6 +188,11 @@ bool FilterWorker::isCancelled()
|
|||
void FilterWorker::applyFilterInBackground()
|
||||
{
|
||||
try {
|
||||
// This background thread is the new writer. This is required to
|
||||
// avoid read-locking from the UI thread from Editor and Timeline
|
||||
// onPaint() events.
|
||||
m_filterMgr->updateWriterThread();
|
||||
|
||||
// Apply the filter
|
||||
m_filterMgr->applyToTarget();
|
||||
|
||||
|
|
|
@ -124,6 +124,11 @@ Doc::LockResult Doc::upgradeToWrite(int timeout)
|
|||
return res;
|
||||
}
|
||||
|
||||
void Doc::updateWriterThread()
|
||||
{
|
||||
m_rwLock.updateWriterThread();
|
||||
}
|
||||
|
||||
void Doc::downgradeToRead(LockResult lockResult)
|
||||
{
|
||||
DOC_TRACE("DOC: downgradeToRead", this, (int)lockResult);
|
||||
|
|
|
@ -82,6 +82,7 @@ public:
|
|||
LockResult readLock(int timeout);
|
||||
LockResult writeLock(int timeout);
|
||||
LockResult upgradeToWrite(int timeout);
|
||||
void updateWriterThread();
|
||||
void downgradeToRead(LockResult lockResult);
|
||||
void unlock(LockResult lockResult);
|
||||
|
||||
|
|
Loading…
Reference in New Issue