Wrap ChFunction in a ChSharedPtr.