the destructor is called "free_method" in Pd-lingo and is set via
class_new() [1].
so you basically would do:
void myclass_free(t_myclass*x) {
free(x->x_ptr);
}
// ...
void myclass_setup(void) {
class_new(gensym("myclass"), myclass_new, myclass_free,
sizeof(t_myclass), 0, ...);
}