Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!think.com!yale!quasi-eli!cs.yale.edu!cs.yale.edu!bitting-douglas From: bitting-douglas@cs.yale.edu (Douglas Bitting) Newsgroups: comp.sys.mac.programmer Subject: Interesting Handle bug... Message-ID: <1991Apr25.180359.23484@cs.yale.edu> Date: 25 Apr 91 18:03:59 GMT Sender: news@cs.yale.edu (Usenet News) Organization: Yale University Computer Science Dept., New Haven, CT 06520-2158 Lines: 36 Originator: bitting@suned.CS.Yale.Edu Nntp-Posting-Host: zoo-gw.cs.yale.edu Well, this one has escaped me. I have stepped though my program several times, check return values, etc etc etc. However, I still can't find out what is wrong. Basically, this is what happens: I call someFunction() where someFunction is: void someFunction() { Handle h1; [some stuff] h1 = NewHandle (someSmallSize); [some more stuff] } and every time I call it, h1 is set to the *same* master pointer. I don't want this to happen; h1 is retained to be used outside of the function (Yes, I store the h1 away carefully in the [some more stuff] part). I never DisposHandle(h1) anywhere in this function, nor do I get rid of the Handle outside of the function. This happens whether or not I have called HNoPurge (h1); I don't get it! What makes it even stranger is the fact that this is the first call to NewHandle within the function and every subsequent call works (ie, the call returns a different master pointer each time through the loop). It is *only* this first call to NewHandle() within the function that get messed up! Anyone out there have any brilliant ideas? Please email them to me if you do. Thanks, -- Doug Bitting | "And we know that in all things God works PO Box 3043 Yale Station | for the good of those who love him..." New Haven, CT 06520 | --Romans 8:28 bitting@cs.yale.edu +------------------------------------------