Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Showing with 10 additions and 7 deletions.
  1. +10 −7 framework/core/OnigRegexp.m
View
17 framework/core/OnigRegexp.m
@@ -114,13 +114,16 @@ + (OnigRegexp*)compile:(NSString*)expression options:(OnigOption)theOptions erro
regex_t* entity = 0;
const UChar* str = (const UChar*)[expression cStringUsingEncoding:STRING_ENCODING];
- int status = onig_new(&entity,
- str,
- str + [expression length] * CHAR_SIZE,
- option,
- ONIG_ENCODING,
- ONIG_SYNTAX_DEFAULT,
- &err);
+ int status;
+ @synchronized([OnigRegexp class]) {
+ status = onig_new(&entity,
+ str,
+ str + [expression length] * CHAR_SIZE,
+ option,
+ ONIG_ENCODING,
+ ONIG_SYNTAX_DEFAULT,
+ &err);
+ }
if (status == ONIG_NORMAL) {
return [[[self alloc] initWithEntity:entity expression:expression] autorelease];

No commit comments for this range

Something went wrong with that request. Please try again.