Path: utzoo!utgpu!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!hplabs!hpl-opus!hpccc!hp-ses!hpcea!hpausla!jcl From: jcl@hpausla.HP.COM (Jeff Laing) Newsgroups: comp.sys.mac.programmer Subject: Re: Re: A plea for help (double-clicking disabled in Finder...) Message-ID: <2580011@hpausla.HP.COM> Date: 23 Jan 89 22:20:08 GMT References: <379@lclark.UUCP> Organization: HP Australian Software Operation Lines: 31 In article <379@lclark.UUCP>, dan@lclark.UUCP (Dan Revel) writes... > Chernicoff's program has several bugs in it, and this is a manifestation > of one of them. I think he sets the event mask (filtering out mouseUp ?) One of the saddest realizations I had was that even Chernicoff's code had bugs in it; I found it out the easy way, by reading it in as I typed it (yes, I had to type from the book). Its also amazing how much other source code I have seen floating around that has the same problem. So, in the interest of letting someone else avoid a problem that 'nearly' got me. You really need to watch those handles being locked and unlocked a lot. The number of times I have seen ... a() { HLock(h); b(h); *h->x = ... /* this would no survive a heap scramble */ HUnlock(h); } b(h) Handle h; { HLock(h); ... HUnlock(h); } (Yeh, yeh, Chernicoff was in pascal. But I'm in C-mode at the moment and you get my point anyway ...)