Skip to content

Finalizing a zero initialized context is not allowed, contrary to the semantics of all the others rcl_*_fini functions #814

@ivanpauno

Description

@ivanpauno

Feature request

Feature description

For most rcl objects, the following code works:

rcl_<type>_t foo = rcl_get_zero_initialized_<type>();
assert(RCL_RET_OK == rcl_<type>_fini(&foo));

That's not the case for <type> = context, in that case it's returning RCL_RET_INVALID_ARGUMENT,

e.g.:

I ran into this while working in rcljava.
Though this might be considered a bug in rcljava code, it's strange that we follow different semantics in constructor/destructor functions of different objects in the same package.

I think that it would also be great to have a clear style guide on how to name constructor/destructor in C code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions