Skip to content

Commit b98c25b

Browse files
committed
fix: fixing nyxian crashing when LDEWindowSessionApplication uses background timer
1 parent e966e06 commit b98c25b

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

Config.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
// https://developer.apple.com/documentation/xcode/adding-a-build-configuration-file-to-your-project
1010

1111
VERSION = 0.9.0
12-
BUILD_NUMBER = 20260223.54.US.seanistethered
12+
BUILD_NUMBER = 20260223.80.US.seanistethered

Nyxian/LindChain/Multitask/ProcessManager/LDEProcess.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ - (instancetype)initWithBundleIdentifier:(NSString*)bundleID
181181
{
182182
klog_log(@"LDEProcess", @"failed to remove pid %d", innerSelf.pid);
183183
}
184-
185-
kvo_release(innerSelf.proc);
186184
}
187185
#endif /* !JAILBREAK_ENV */
188186

@@ -371,4 +369,13 @@ - (void)scene:(FBScene *)arg1 didCompleteUpdateWithContext:(FBSceneUpdateContext
371369
});
372370
}
373371

372+
#if !JAILBREAK_ENV
373+
374+
- (void)dealloc
375+
{
376+
kvo_release(_proc);
377+
}
378+
379+
#endif /* JAILBREAK_ENV */
380+
374381
@end

Nyxian/LindChain/Multitask/WindowServer/Session/LDEWindowSessionApplication.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,16 @@ - (BOOL)deactivateWindow
171171
[self.presenter deactivate];
172172

173173
// Do it like on iOS, give application time window for background tasks
174+
__weak typeof(self) weakSelf = self;
174175
self.backgroundEnforcementTimer = [NSTimer scheduledTimerWithTimeInterval:15.0 repeats:NO block:^(NSTimer *sender){
175-
if(!self.backgroundEnforcementTimer) return;
176-
[self.process suspend];
176+
__strong typeof(self) innerSelf = weakSelf;
177+
if(innerSelf == nil)
178+
{
179+
return;
180+
}
181+
182+
if(!innerSelf.backgroundEnforcementTimer) return;
183+
[innerSelf.process suspend];
177184
}];
178185

179186
os_unfair_lock_unlock(&lock);

0 commit comments

Comments
 (0)