Details
-
New Feature
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.2.0
-
None
-
All
Description
A DCB includes a pointer to "data". The DCB does not know what this data is, because it is dependent on how the DCB is being used. It may be the same "data" as is also pointed to by a session object.
The lack of knowledge currently means that the DCB does not handle freeing of the data, because it does not know what is involved. The logic of ensuring that it is freed is tortuous and indirect, and very difficult to validate.
It might be preferable to include in the DCB alongside the pointer to "data" a function pointer to the function that can free the data. The function might simply be the standard free function, but using a function pointer guarantees that the mechanism remains flexible.