When using Schema::add to register a new schema, the library returns a pointer to the cached schema but it's wrapped in a SchemaImpl object. By returning the wrapper as a pointer the ownership lies with the caller, but when the caller tries to remove the wrapper object the inner schema is always removed as well leading to a crash:
When using Schema::add to register a new schema, the library returns a pointer to the cached schema but it's wrapped in a SchemaImpl object. By returning the wrapper as a pointer the ownership lies with the caller, but when the caller tries to remove the wrapper object the inner schema is always removed as well leading to a crash:
The interface doesn't allow to detach the inner object either.
Allocation done here: https://github.com/confluentinc/libserdes/blob/master/src-cpp/Serdes.cpp#L176