From 1671fa4e57bc813f7e0b4423662961d9e55d7d6e Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 5 Nov 2010 09:16:12 -0700 Subject: The Reorganizing text must come after container_ is allocated. --- MobileCydia.mm | 66 ++++++++++++++++++++++++++++------------------------------ 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index 97cc8c1..8482fe2 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -8557,40 +8557,6 @@ static _finline void _setHomePage(Cydia *self) { database_ = [Database sharedInstance]; - if ( - readlink("/Applications", NULL, 0) == -1 && errno == EINVAL || - readlink("/Library/Ringtones", NULL, 0) == -1 && errno == EINVAL || - readlink("/Library/Wallpaper", NULL, 0) == -1 && errno == EINVAL || - //readlink("/usr/bin", NULL, 0) == -1 && errno == EINVAL || - readlink("/usr/include", NULL, 0) == -1 && errno == EINVAL || - readlink("/usr/lib/pam", NULL, 0) == -1 && errno == EINVAL || - readlink("/usr/libexec", NULL, 0) == -1 && errno == EINVAL || - readlink("/usr/share", NULL, 0) == -1 && errno == EINVAL || - //readlink("/var/lib", NULL, 0) == -1 && errno == EINVAL || - false - ) { - [self setIdleTimerDisabled:YES]; - - hud_ = [self addProgressHUD]; - [hud_ setText:@"Reorganizing:\n\nWill Automatically\nClose When Done"]; - [self setStatusBarShowsProgress:YES]; - - [self yieldToSelector:@selector(system:) withObject:@"/usr/libexec/cydia/free.sh"]; - - [self setStatusBarShowsProgress:NO]; - [self removeProgressHUD:hud_]; - hud_ = nil; - - if (ExecFork() == 0) { - execlp("launchctl", "launchctl", "stop", "com.apple.SpringBoard", NULL); - perror("launchctl stop"); - } - - return; - } - - _trace(); - NSMutableArray *items([NSMutableArray arrayWithObjects: [[[UITabBarItem alloc] initWithTitle:@"Cydia" image:[UIImage applicationImageNamed:@"home.png"] tag:kCydiaTag] autorelease], [[[UITabBarItem alloc] initWithTitle:UCLocalize("SECTIONS") image:[UIImage applicationImageNamed:@"install.png"] tag:kSectionsTag] autorelease], @@ -8623,6 +8589,38 @@ static _finline void _setHomePage(Cydia *self) { [container_ setTabBarController:tabbar_]; [window_ addSubview:[container_ view]]; + if ( + readlink("/Applications", NULL, 0) == -1 && errno == EINVAL || + readlink("/Library/Ringtones", NULL, 0) == -1 && errno == EINVAL || + readlink("/Library/Wallpaper", NULL, 0) == -1 && errno == EINVAL || + //readlink("/usr/bin", NULL, 0) == -1 && errno == EINVAL || + readlink("/usr/include", NULL, 0) == -1 && errno == EINVAL || + readlink("/usr/lib/pam", NULL, 0) == -1 && errno == EINVAL || + readlink("/usr/libexec", NULL, 0) == -1 && errno == EINVAL || + readlink("/usr/share", NULL, 0) == -1 && errno == EINVAL || + //readlink("/var/lib", NULL, 0) == -1 && errno == EINVAL || + false + ) { + [self setIdleTimerDisabled:YES]; + + hud_ = [self addProgressHUD]; + [hud_ setText:@"Reorganizing:\n\nWill Automatically\nClose When Done"]; + [self setStatusBarShowsProgress:YES]; + + [self yieldToSelector:@selector(system:) withObject:@"/usr/libexec/cydia/free.sh"]; + + [self setStatusBarShowsProgress:NO]; + [self removeProgressHUD:hud_]; + hud_ = nil; + + if (ExecFork() == 0) { + execlp("launchctl", "launchctl", "stop", "com.apple.SpringBoard", NULL); + perror("launchctl stop"); + } + + return; + } + [self performSelector:@selector(loadData) withObject:nil afterDelay:0]; } -- cgit v1.2.3