Deallocation function for mxj~ objects (like dsp_free)

mattb243's icon

I've written C max/msp objects before and they had an exit function "dsp_free". I'd like to have something like that for my java objects as well, but can't find anything in the documentation.

I have a bluetooth server-socket running inside the mxj~ object that needs to be closed properly upon exit, if you were wondering why.

Thank you in advance!

Matty

nick rothwell | project cassiel's icon

MSPObject (which I assume mxj~ expects - I've not used it) is a subclass of MaxObject, so you should be able to implement notifyDeleted() to get notification of the deletion of the peer mxj~ instance.

JavaProgrammer's icon

When I was writing Threaded Java objects, I very rapidly learned to use notifyDeleted(). Otherwise I had threads going in the background with no way of stopping them. (That I know of).

Could you please tell me how the bluetooth serversocket works?