Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!apple!well!brecher From: brecher@well.UUCP (Steve Brecher) Newsgroups: comp.sys.mac.programmer Subject: Re: Moving resources into the system file Message-ID: <12856@well.UUCP> Date: 25 Jul 89 20:00:07 GMT References: <1230@uvm-gen.UUCP> <8065@hoptoad.uucp> <12810@well.UUCP> <8102@hoptoad.uucp> Reply-To: brecher@well.UUCP (Steve Brecher) Distribution: na Organization: Software Supply, Sunnyvale, CA Lines: 24 In article <8102@hoptoad.uucp>, tim@hoptoad.uucp (Tim Maroney) writes: > So perhaps under MultiFinder all resources in the system file are read > into the system heap whether they have the system heap bit set or not. Correct. This applies also to resources in suitcase files opened with Suitcase II. > So, the original questioner could do a ReleaseResource as I suggested, > but a better approach would be to allocate the resource storage in the > system heap before adding it to the system file. Then the > ReleaseResource becomes unneccessary. Allocating the resource storage in the system heap would have avoided the dangling-handle problem even if ReleaseResource were not called. But omitting ReleaseResource would introduce another problem: heap clogging. If not ReleaseResource, then HPurge would be required to avoid possible heap overflow. Further, one has better control over application heap management than system heap management, so I think that the original approach, with ReleaseResource added, is the best solution. -- brecher@well.UUCP (Steve Brecher)