From 7c22ecf28bbcccd64fe55f5f52481589bb23ab08 Mon Sep 17 00:00:00 2001 From: Rustam Gamidov Date: Mon, 16 Jun 2025 15:41:42 +0300 Subject: [PATCH] Store Scope in OLPHttpClient to prolong lifetime An attempt to make static objects to live long enough when parent objects are destructed randomly Relates-To: HERESDK-6943 Signed-off-by: Rustam Gamidov --- olp-cpp-sdk-core/src/http/ios/OLPHttpClient.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/olp-cpp-sdk-core/src/http/ios/OLPHttpClient.mm b/olp-cpp-sdk-core/src/http/ios/OLPHttpClient.mm index 0ad49d5cd..ffaace01c 100644 --- a/olp-cpp-sdk-core/src/http/ios/OLPHttpClient.mm +++ b/olp-cpp-sdk-core/src/http/ios/OLPHttpClient.mm @@ -25,6 +25,7 @@ #include #include "context/ContextInternal.h" +#include "olp/core/context/Context.h" #include "olp/core/context/EnterBackgroundSubscriber.h" #include "olp/core/http/Network.h" #include "olp/core/logging/Log.h" @@ -80,6 +81,7 @@ @interface OLPHttpClient () @implementation OLPHttpClient { NSOperationQueue* _delegateQueue; + olp::context::Context::Scope _scope; std::shared_ptr _enterBackgroundSubscriber; }