bug: DartCObject does not handle cases except Int8/Uint8, making memory leak
fzyzcjy opened this issue · comments
Hi thanks for the lib. I see DartCObject does not handle cases except Int8/Uint8, making memory leak. It can be clearly seen from the code:
possibly, a panic can be made instead of no-op.
that's because we only found these are the common types for DartTypedData
, feel free to open a PR if you have a use-case that uses other types of DartTypedData
.
The commonly used tho is Vec<u8>
and as we didn't implement the IntoDart
trait for things other than Vec<u8>
and Vec<i8>
this is not really an issue unless you started using the raw DartCObject
on your own.
As I said, if there is a use case, PRs are always welcome!
Sure. My suggestion is to panic
for other types, instead of no-op. Because one day if we add other types, and forget to add code here, we want explicit errors, instead of implicitly leaking a lot of memory.