From 0e7defdd720ceffe70e0ab2d96f50ed78394f4c1 Mon Sep 17 00:00:00 2001 From: Dario Gabriel Lipicar Date: Thu, 9 Apr 2026 19:14:19 -0300 Subject: [PATCH] fix async call crash --- cpp/logos_api_consumer.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cpp/logos_api_consumer.cpp b/cpp/logos_api_consumer.cpp index 7e13006..fcb23ab 100644 --- a/cpp/logos_api_consumer.cpp +++ b/cpp/logos_api_consumer.cpp @@ -106,9 +106,15 @@ void LogosAPIConsumer::invokeRemoteMethodAsync(const QString& authToken, const Q QPointer 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(); }); }