Skip to content

Commit

Permalink
Merge pull request #2942 from mstepanov/timob-9492
Browse files Browse the repository at this point in the history
[TIMOB-9492] iOS: fix loss of JS reference to camera overlay
  • Loading branch information
srahim committed Sep 18, 2012
2 parents 5486a27 + ef8e9bd commit 3de1443
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion iphone/Classes/MediaModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ -(void)destroyPickerCallbacks
-(void)destroyPicker
{
RELEASE_TO_NIL(popover);
[self forgetProxy:cameraView];
RELEASE_TO_NIL(cameraView);
RELEASE_TO_NIL(editor);
RELEASE_TO_NIL(editorSuccessCallback);
Expand Down Expand Up @@ -306,6 +307,7 @@ -(void)closeModalPicker:(UIViewController*)picker_
}
if (cameraView != nil) {
[cameraView windowDidClose];
[self forgetProxy:cameraView];
RELEASE_TO_NIL(cameraView);
}
}
Expand Down Expand Up @@ -894,7 +896,12 @@ -(BOOL)isCameraSupported;
-(void)showCamera:(id)args
{
ENSURE_SINGLE_ARG_OR_NIL(args,NSDictionary);
ENSURE_UI_THREAD(showCamera,args);
if (![NSThread isMainThread]) {
[self rememberProxy:[args objectForKey:@"overlay"]];
TiThreadPerformOnMainThread(^{[self showCamera:args];},NO);
return;
}

[self showPicker:args isCamera:YES];
}

Expand Down Expand Up @@ -1107,6 +1114,7 @@ -(void)hideCamera:(id)args
}
if (cameraView != nil) {
[cameraView windowDidClose];
[self forgetProxy:cameraView];
RELEASE_TO_NIL(cameraView);
}
[self destroyPicker];
Expand Down

0 comments on commit 3de1443

Please sign in to comment.