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
Is your feature request related to a problem? Please describe.
The management of instance destruction for managed code is now delegated to the garbage collector. This way it is not possible to know what is going on behind the scenes and this can lead to problematic behavior and bugs.
Describe the solution you'd like
Implementing the IDisposable interface in C# and AutoClosable interface in Java for classes related to native code and manage it in native code, to let the developers have more control on what the code really do.
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered:
@marcocappolimases from the point of view of C# (.NET) I think it is another enhancement to use SafeAccessTokenHandle beside to IDisposable pattern to manage the native pointer of C++ interfaces. In Java we use just a long and a different approach to reach underlying layer.
Another improvements to be done is to reference SmartDataDistribution instance within the SmartDataDistributionChannel instance and use the native pointer, or the long in Java, from SmartDataDistribution avoiding the actual copy which is done: actually the copy decouples, in the managed code, the two classes even if they are intimately linked each other. This can prevents the GC to dispose (close) the native pointer related to SmartDataDistribution before every instance of SmartDataDistributionChannel were released.
Another point found during the analysis of the feature: it is missing a method to destroy the native pointer related to SmartDataDistribution. It is important to add a method to the C ++ class DataDistribution like delete (IDataDistribution *) and implements wrappers from C # and Java. The destruction of DataDistribution instance shall be related to the destruction of the subsystem, this implies all channels shall be removed first.
mariomastrodicasa
added a commit
to mariomastrodicasa/DataDistributionManager
that referenced
this issue
Oct 13, 2021
Is your feature request related to a problem? Please describe.
The management of instance destruction for managed code is now delegated to the garbage collector. This way it is not possible to know what is going on behind the scenes and this can lead to problematic behavior and bugs.
Describe the solution you'd like
Implementing the IDisposable interface in C# and AutoClosable interface in Java for classes related to native code and manage it in native code, to let the developers have more control on what the code really do.
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: