Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!unisoft!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Application Unexpectedly Quits Message-ID: <8712@hoptoad.uucp> Date: 16 Oct 89 00:13:35 GMT References: <5174@lindy.Stanford.EDU> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 19 In article <5174@lindy.Stanford.EDU> GG.DAR@forsythe.stanford.edu (Aaron Reizes) writes: >I have an application (MPW C3.0) that allocates most of its >structures using non-relocatable pointers (NewPtr). If the user >opens lots of windows so that there is not much memory left, and >then selects an option that loads a large code segment, my >application unexpectedly quits. > >Have others found this problem, and what is considered the proper >procedure to prevent it, or correct it. The proper procedure, not to be too flip, is to use NewHandle instead of NewPtr. If you use NewPtr's and your code is such that memory can fill up under normal conditions, then you're asking for this kind of problem. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "This signature is not to be quoted." -- Erland Sommarskog