fix: bind image fetch callback lambda to the parent object
Fixes a possible crash with the callback being called after the image object was already deleted. Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
aaef448959
commit
756d933d1a
@ -101,7 +101,7 @@ void VariableSizedImageObject::loadImage(QTextDocument* doc, const QUrl& source,
|
|||||||
|
|
||||||
auto full_entry_path = entry->getFullPath();
|
auto full_entry_path = entry->getFullPath();
|
||||||
auto source_url = source;
|
auto source_url = source;
|
||||||
connect(job, &NetJob::succeeded, [this, doc, full_entry_path, source_url, posInDocument] {
|
connect(job, &NetJob::succeeded, this, [this, doc, full_entry_path, source_url, posInDocument] {
|
||||||
qDebug() << "Loaded resource at" << full_entry_path;
|
qDebug() << "Loaded resource at" << full_entry_path;
|
||||||
|
|
||||||
// If we flushed, don't proceed.
|
// If we flushed, don't proceed.
|
||||||
|
Loading…
Reference in New Issue
Block a user