Description
Under certain circumstances, creating a RegularExpression will result in memory being allocated and potentially de-allocated correctly. There are two problems:
1. Memory is allocated from the global heap for instances of BMPattern.
2. Memory for a string is allocated from the global MemoryManager instance, but de-allocated using an instance-specific MemoryManager instance.
I will attach a patch for the problems.