The manpage of MatShellSetOperation states that "all user-provided functions should have the same calling sequence as the usual matrix interface routines", but this does not apply to MATOP_DESTROY due to the change MatDestroy(Mat)-->MatDestroy(Mat*) in 3.2.
One possible fix would be that all MatDestroy_* functions receive a pointer. Or alternatively warn about the exception in the manpage of MatShellSetOperation. Jose