Skip to content

Proper NetworkCurl lifetime management - #1716

Merged
andrey-kashcheev merged 9 commits into
heremaps:masterfrom
exposight:network-curl-proper-ownership
Jul 23, 2026
Merged

andrey-kashcheev merged 9 commits into
heremaps:masterfrom
exposight:network-curl-proper-ownership

Conversation

@exposight

Copy link
Copy Markdown
Contributor

The NetworkCurl is made safe against being destroyed from its own callbacks (header, data, completion). The following was made:

  • RequestHandle no longer holds the NetworkCurl, it holds the actual necessary shared data instead
  • a part of NetworkCurl is extracted to internal Impl class encapsulating everything needed for internal worker thread; such way that thread does not need any reference to NetworkCurl and in turn the thread won't own itself
  • the worker thread holds a strong reference to the Impl instance, so it won't get destroyed until the worker thread completes
  • all the resources are cleaned up regardless of the way the worker thread exits (either via join or via detach)

Relates-To: HERESDK-4984, OCMAM-772

Vasyl Bilous added 9 commits July 22, 2026 11:21
The NetworkCurl is made safe against being destroyed from its own callbacks (header, data, completion). The following was made:
 - RequestHandle no longer holds the NetworkCurl, it holds the actual necessary shared data instead
 - a part of NetworkCurl is extracted to internal Impl class encapsulating everything needed for internal worker thread; such way that thread does not need any reference to NetworkCurl
 - the worker thread holds a strong reference to the Impl instance, so it won't get destroyed until the worker thread completes
 - all the resources are cleaned up regardless of the way the worker thread exits (either via join or via detach)

Relates-To: OCMAM-772

Signed-off-by: Vasyl Bilous <ext-vasyl.bilous@here.com>
Signed-off-by: Vasyl Bilous <ext-vasyl.bilous@here.com>
Signed-off-by: Vasyl Bilous <ext-vasyl.bilous@here.com>
Signed-off-by: Vasyl Bilous <ext-vasyl.bilous@here.com>
Signed-off-by: Vasyl Bilous <ext-vasyl.bilous@here.com>
Signed-off-by: Vasyl Bilous <ext-vasyl.bilous@here.com>
Signed-off-by: Vasyl Bilous <ext-vasyl.bilous@here.com>
Signed-off-by: Vasyl Bilous <ext-vasyl.bilous@here.com>
To fix the build without exceptions.

Relates-To: HERESDK-4984, OCMAM-772

Signed-off-by: Vasyl Bilous <ext-vasyl.bilous@here.com>
@andrey-kashcheev
andrey-kashcheev merged commit 3496dd4 into heremaps:master Jul 23, 2026
43 checks passed
@exposight
exposight deleted the network-curl-proper-ownership branch July 23, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants