User Rank: Newbie Joined: 11/4/2009 Posts: 6
|
I don't know how much people here could help with this, since I'm accessing the Mac host software. For some reason my code has developed a problem where *every* call to LS beyond LS_DiscPrintMgr_Create quits when it's run from a second thread. The second thread is created with detachNewThreadSelector and is not retained. There is only a single function operating in the detached thread which sets the callbacks and calls either PrintDisc or PrintPreview. The docs say that detachNewThreadSelector should take care of retaining and releasing the thread when the function finishes. I've disabled the code that gets rid of the LS structures, so its not that they are deallocated before the Print thread is done with them. Even PrintPreview fails - although earlier in the day PrintDisc would work, but not PrintPreview.
The application just *fails* - it doesn't even drop into GDB, just quits. NSLog causes it to fail the same way, so I suspect a memory issue with the second thread.
The code has worked for days, so I don't know what's going on. GDB also doesn't seem to work when I set breakpoints in function called in the second thread, which didn't happen before. GDB reports errors getting registers, and once it said dlopen() couldn't be called - so perhaps it's something about the system trying to access the LS functions from the dylib? There ARE calls in the primary thread, so the symbols should have been resolved in the primary thread.
Anyone here experienced with thread programming on Mac?
|