PETSc Segmentation Fault

Dear all,
I was working on my wrap for SLEPc, source code can be found here and noticed that the NGSolve PETSc wrap give a segmentation fault error. Apparently, this error is the result of registering the precondition oner in PETSc because if I comment on the last line in the the segmentation fault disappear.
Kind regards,
Umberto Zerbinati