]> git.saurik.com Git - cydia.git/blobdiff - MobileCydia.mm
Add debugging to isSafeToSuspend:.
[cydia.git] / MobileCydia.mm
index 3c2c3b204d369f0cef741f0b444f7d6e751e0ab8..f24459b3d3714eec55a0fa62ad03bacf215ece90 100644 (file)
@@ -9376,6 +9376,13 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 }
 
 - (BOOL) isSafeToSuspend {
+    if (locked_ != 0) {
+#if !ForRelease
+        NSLog(@"isSafeToSuspend: locked_ != 0");
+#endif
+        return false;
+    }
+
     // Use external process status API internally.
     // This is probably a really bad idea.
     // XXX: what is the point of this? does this solve anything at all?
@@ -9386,7 +9393,17 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
         notify_cancel(notify_token);
     }
 
-    return locked_ == 0 && status == 0;
+    if (status != 0) {
+#if !ForRelease
+        NSLog(@"isSafeToSuspend: status != 0");
+#endif
+        return false;
+    }
+
+#if !ForRelease
+    NSLog(@"isSafeToSuspend: -> true");
+#endif
+    return true;
 }
 
 - (void) applicationSuspend:(__GSEvent *)event {