Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
TIMOB-6808 Have the KrollBridge unprotect JS modules when removing pr…
Browse files Browse the repository at this point in the history
…oxies.
  • Loading branch information
WhichKatieDid committed Dec 21, 2011
1 parent 381cffc commit 7199c7a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions iphone/Classes/KrollBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,14 @@ -(void)removeProxies
{
CFRelease(oldProxies);
}

for (NSString * thisModuleKey in modules) {
id thisModule = [modules objectForKey:thisModuleKey];
if ([thisModule respondsToSelector:@selector(unprotectJsobject)]) {
[thisModule unprotectJsobject];
}
}
RELEASE_TO_NIL(modules);
}

-(void)dealloc
Expand All @@ -303,7 +311,6 @@ -(void)dealloc
RELEASE_TO_NIL(preload);
RELEASE_TO_NIL(context);
RELEASE_TO_NIL(titanium);
RELEASE_TO_NIL(modules);
OSSpinLockLock(&krollBridgeRegistryLock);
CFSetRemoveValue(krollBridgeRegistry, self);
OSSpinLockUnlock(&krollBridgeRegistryLock);
Expand Down Expand Up @@ -618,7 +625,6 @@ -(void)didStopNewContext:(KrollContext*)kroll
RELEASE_TO_NIL(titanium);
RELEASE_TO_NIL(context);
RELEASE_TO_NIL(preload);
RELEASE_TO_NIL(modules);
[self autorelease]; // Safe to release now that the context is done
}

Expand Down

0 comments on commit 7199c7a

Please sign in to comment.