I am completing an Android program to classify the genre of a song on a mobile phone. The classification code is implemented in a native shared library (not written by me). Unfortunately, it only classifies correctly the first time, any times after then it just returns the previous result. I was thinking this was to do with the fact that some of the variables in the code are declared static and that they are not being instantiated properly between classifications.
I need to know how I can free the memory associated with a native library after each classification so that all the variables are instantiated correctly in the next classification.
I currently call the native library via a class, can I ‘free’ the class (like in C/C++) explicitly without waiting for the garbage collector?
@qrtt1 was right, searched through the code for a reset function and I found one… thanks!