Quote:
Originally Posted by pblankenbaker
I'm not really sure if calling free() is required on image objects (in Java you would hope that resources would be automatically freed by the garbage collector), I just know that our problem went away once we started invoking free().
|
The way native libraries work in Java is usually that you must call some sort of cleanup method manually. The garbage collector will clean up
java objects, but not memory from native libraries and as you know, C(++) does not have a garbage collector.
(there must be a good reason that wpilib isn't using finalize() to call free() - maybe finalize is unreliable?)
Anyway, I have to go with the previously stated recommendation, that you reuse the same image object. NI vision allows you to do that.