threadparallelparadigm: fixed possible memory leak