[physfs] PhysFS on iOS

Josh de Lioncourt overlord at lioncourt.com
Mon Mar 5 08:30:29 EST 2012

Hi all,

I've been experimenting with PhysFS on the iOS platform for a while. It works pretty well, but I've hit one minor glitch that I thought I'd ask about in case anyone knows what causes this, or can offer any insight that might get me going in the right direction for solving it myself.

Initializing PhysFS, mounting archives, reading files, and deinitializing all works perfectly.

The problem crops up with apps that move to the background.

Per Apple's recommendations, I unmount and deinit PhysFS when the app moves to the background.

When the app becomes active again, I initialize PhysFS, which works fine.

The problem occurs when I try to remount the archive which was removed when the app moved to the background.

At this point, I receive no errors that I can detect, but the app crashes on __PHYSFS_platformGrabMutex

I honestly don't know much about the inner workings of PhysFS.

The only thing I could think of was that perhaps I need to manually remove any mounted archives before deinit, but that would be extremely inconvenient. Besides, it is my understanding that that is part of deinit's job.

Finally, if the app is set to terminate instead of moving to the background and entering the "suspended" state, everything works as expected.

Thanks for any suggestions.

More information about the physfs mailing list