Skip to content

Commit

Permalink
fix(ios): remove additional gc protection once proxy is remembered (#…
Browse files Browse the repository at this point in the history
…11028)

* fix(ios): remove additional gc protection once proxy is remembered

* chore: add temporary debug function

* chore: remove debug function
  • Loading branch information
janvennemann authored and lokeshchdhry committed Oct 14, 2019
1 parent 8192ea2 commit 2ac7d80
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,12 @@ - (void)rememberProxy:(TiProxy *)rememberedProxy
if ((bridgeCount == 1) && (pageKrollObject != nil)) {
if (rememberedProxy == self) {
[pageKrollObject protectJsobject];
[pageKrollObject removeGarbageCollectionSafeguard];
return;
}
[pageKrollObject noteKeylessKrollObject:[rememberedProxy krollObjectForBridge:(KrollBridge *)pageContext]];
KrollObject *krollObject = [rememberedProxy krollObjectForBridge:(KrollBridge *)pageContext];
[pageKrollObject noteKeylessKrollObject:krollObject];
[krollObject removeGarbageCollectionSafeguard];
return;
}
if (bridgeCount < 1) {
Expand All @@ -652,13 +655,16 @@ - (void)rememberProxy:(TiProxy *)rememberedProxy
if (rememberedProxy == self) {
KrollObject *thisObject = [thisBridge krollObjectForProxy:self];
[thisObject protectJsobject];
[thisObject removeGarbageCollectionSafeguard];
continue;
}

if (![thisBridge usesProxy:rememberedProxy]) {
continue;
}
[[thisBridge krollObjectForProxy:self] noteKeylessKrollObject:[thisBridge krollObjectForProxy:rememberedProxy]];
KrollObject *krollObject = [thisBridge krollObjectForProxy:rememberedProxy];
[[thisBridge krollObjectForProxy:self] noteKeylessKrollObject:krollObject];
[krollObject removeGarbageCollectionSafeguard];
}
}

Expand Down

1 comment on commit 2ac7d80

@hansemannn
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janvennemann @jquick-axway This was the commit I mentioned in https://jira.appcelerator.org/browse/TIMOB-27875. I am willing to provide what ever is needed to get this solved.

Please sign in to comment.