fix async call crash (#49)

* fix async call crash

* add regression test
This commit is contained in:
Dario Lipicar
2026-04-10 10:39:14 -04:00
committed by GitHub
parent 8b1cfadf09
commit 2a21637e02
5 changed files with 71 additions and 3 deletions
+8 -2
View File
@@ -106,9 +106,15 @@ void LogosAPIConsumer::invokeRemoteMethodAsync(const QString& authToken, const Q
QPointer<LogosAPIConsumer> self(this);
plugin->callMethodAsync(authToken, methodName, args, timeout.ms,
[plugin, callback, self](QVariant result) {
plugin->release();
if (!self) return;
// Deliver the result before release(): destroying the replica can
// invalidate storage that QVariant still references for some return
// types (matches sync invokeRemoteMethod: callMethod then release).
if (!self) {
plugin->release();
return;
}
callback(result);
plugin->release();
});
}