You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using cpp_wrapper AeronArchive::connect(globalCtx), it appears that a new Context is recreated within the AeronArchive::connect method. This Context object has own_aeron_client = false, but when the Context object is destroyed, it also deletes the memory of *aeron_t. This will cause globalCtx to be unusable afterward, as globalCtx.m_aeron_archive_ctx_t.aeron becomes a dangling pointer. Calling AeronArchive::connect(globalCtx) again will result in a memory access error. Is it necessary to warn users that the context can only be used within the method and should only be used once?
`
int aeron_archive_async_connect(aeron_archive_async_connect_t **async, aeron_archive_context_t *ctx)
{
// ...
if (aeron_archive_context_duplicate(&_async->ctx, ctx) < 0)
{
AERON_APPEND_ERR("%s", "");
aeron_free(_async);
return -1;
}
// Now that we've copied the original context into the _async->ctx, the original ctx no longer owns the aeron client.
aeron_archive_context_set_owns_aeron_client(ctx, false);
// ...
*async = _async;
return 0;
}
`
The text was updated successfully, but these errors were encountered:
When using
cpp_wrapper AeronArchive::connect(globalCtx)
, it appears that a newContext
is recreated within theAeronArchive::connect
method. ThisContext
object hasown_aeron_client = false
, but when theContext
object is destroyed, it also deletes the memory of*aeron_t
. This will causeglobalCtx
to be unusable afterward, asglobalCtx.m_aeron_archive_ctx_t.aeron
becomes a dangling pointer. CallingAeronArchive::connect(globalCtx)
again will result in a memory access error. Is it necessary to warn users that thecontext
can only be used within the method and should only be used once?file: aeron_archive_async_connect.c
method: aeron_archive_async_connec
line:aeron_archive_context_duplicate
`
int aeron_archive_async_connect(aeron_archive_async_connect_t **async, aeron_archive_context_t *ctx)
{
// ...
}
`
The text was updated successfully, but these errors were encountered: