> > On Wednesday, March 24, 2004, at 12:45 PM, Barrie wrote: > >> I was running a program after It was compiled as a stand alone >> application. >> The "built" program froze up at some time during use and I had to do an >> emergency re-start of the computer.<snip> > >> However, I don't >> understand why my built application also destroyed a source code >> resource >> file. > > I think the hard restart did it, not your application. Things weren't > cleaned/closed up just right. > >> I now have two stand alone applications. One of them has the menu >> problem, >> the other is working OK. I opened them both from ResEdit and compared >> their >> resource files paying close attention to the menu resources. So far I >> haven't found any differences in the resource files. There is however a >> difference in their sizes. The "good" app has 48 bytes more than the >> "bad" >> app. > > That's a sign of a corrupted something. If you have known good > resources, what I'd do (and have done) is to create a new resource file > ( Command- D copy) then copy all the known 'good' resources into such, > and then save again. Proceed again using the new copy as the new > "default" after verifying it all works. Retain the other(s) for a > backup. > Makes for a few mb of clutter left around after the dev cycle, but you > can always rebuild using the good components if need be. It's good to > keep spare copies of built apps around for just that purpose. > >> Although this has happened on two occasions, I haven't yet been able to >> identify exactly what actions cause the crash. > > In OS 9 and below, hard freezes like that are almost always in my > experience due to setting to or copying to, a bad or non-existent port. > Copybits'ing to a missing, or no-longer available GWorld or Window port > perchance? > > For sure, SetGWorld() or SetPort() to a bad (invalid) port is a sure > way to super-hard-freeze-doom in classic OS. Suspect that. > > I've tended to do it when setting up a new program and was setting back > to a port I haven't even gained yet from GetPort or GetGWorld, or I'd > disposed of it, and forgotten that I had. Window might have gotten > closed since too...SetPort back to that...the OS doesn't recover from > that very well. > > My disk directories always thanked me after too, when they could > remember what I'd done the hour before...(lost cache, not written) :) > > SetPort or SetGWorld to bad port, likely cause of hard freeze, when not > due to weather or bad relationship. > > If in OS X, suspect more Apple quality control successes. (I can get > them from just doing an internet connection after disconnecting one a > bit before, or after sleeping, about 3rd frame into connect animation, > internal modem) > > Robert > > -- > Robert Many thanks to your great suggestions. I didn't think about the crash causing the menu problem in both resource files. It makes sense and I think I need not continue looking for a bug that kills the menu's in my program. I can now focus on trying to replicate the freeze up. Barrie