Solved memory leak
Removed threads example
New example inproc2 with function selection and parameters