File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
windows/ReactNativeStaticServer Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -36,22 +36,18 @@ void unlock_sem() {
36
36
}
37
37
38
38
void OnSignal (std::string signal, std::string details) {
39
- if (pendingResult) {
40
- if (signal == CRASHED) RNException (" Server crashed" ).reject (*pendingResult);
41
- else pendingResult->Resolve (details);
42
- }
43
- else {
44
- // CAREFUL: sendEvent() depends on server object to get it ID,
45
- // thus MUST BE called before the server instance is dropped below.
46
- mod->sendEvent (signal, details);
47
- }
39
+ // BEWARE: .sendEvent() depends on the server object to get its ID,
40
+ // thus MUST BE called before the object is dropped below, if it is.
41
+ if (!pendingResult) mod->sendEvent (signal, details);
48
42
49
43
if (signal == CRASHED || signal == TERMINATED) {
50
44
delete server;
51
45
server = NULL ;
52
46
}
53
47
54
48
if (pendingResult) {
49
+ if (signal == CRASHED) RNException (" Server crashed" ).reject (*pendingResult);
50
+ else pendingResult->Resolve (details);
55
51
delete pendingResult;
56
52
pendingResult = NULL ;
57
53
unlock_sem ();
You can’t perform that action at this time.
0 commit comments