fixes #11082, export memory leak issue.