Skip to content

Commit

Permalink
[ReactNative] Fix DevMenu crash when launching the app with WebView e…
Browse files Browse the repository at this point in the history
…xecutor
  • Loading branch information
tadeuzagallo committed May 5, 2015
1 parent 08246b7 commit 3ab4d32
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions React/Base/RCTDevMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,17 @@ - (void)updateSettings
{
_settings = [NSMutableDictionary dictionaryWithDictionary:[_defaults objectForKey:RCTDevMenuSettingsKey]];

__weak RCTDevMenu *weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
self.shakeToShow = [_settings[@"shakeToShow"] ?: @YES boolValue];
self.profilingEnabled = [_settings[@"profilingEnabled"] ?: @NO boolValue];
self.liveReloadEnabled = [_settings[@"liveReloadEnabled"] ?: @NO boolValue];
self.executorClass = NSClassFromString(_settings[@"executorClass"]);
RCTDevMenu *strongSelf = weakSelf;
if (!strongSelf) {
return;
}

strongSelf.shakeToShow = [strongSelf->_settings[@"shakeToShow"] ?: @YES boolValue];
strongSelf.profilingEnabled = [strongSelf->_settings[@"profilingEnabled"] ?: @NO boolValue];
strongSelf.liveReloadEnabled = [strongSelf->_settings[@"liveReloadEnabled"] ?: @NO boolValue];
strongSelf.executorClass = NSClassFromString(strongSelf->_settings[@"executorClass"]);
});
}

Expand Down

0 comments on commit 3ab4d32

Please sign in to comment.