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

Proper NetworkCurl lifetime management#1716
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 5 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>
@exposight
exposight force-pushed the network-curl-proper-ownership branch from ebd091f to dfec753 Compare July 22, 2026 08:21
Vasyl Bilous added 3 commits July 22, 2026 11:48
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>
@exposight
exposight force-pushed the network-curl-proper-ownership branch 3 times, most recently from a034ee8 to 9a78492 Compare July 22, 2026 09:11
To fix the build without exceptions.

Relates-To: HERESDK-4984, OCMAM-772

Signed-off-by: Vasyl Bilous <ext-vasyl.bilous@here.com>
@exposight
exposight force-pushed the network-curl-proper-ownership branch from 9a78492 to 7f8d2ca Compare July 22, 2026 11:03
@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