Path: utzoo!attcan!uunet!maverick.ksu.ksu.edu!ux1.cso.uiuc.edu!resnick From: resnick@cogsci.uiuc.edu (Pete Resnick) Newsgroups: comp.sys.mac.programmer Subject: Re: popup hiermenu in cdev bombs later... Message-ID: <1990Oct29.003508.8747@ux1.cso.uiuc.edu> Date: 29 Oct 90 00:35:08 GMT References: <1990Oct28.153715.29247@digibd.com> Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 35 merlyn@digibd.com (Brian Westley (Merlyn LeRoy)) writes: >I'm updating ZoomBar to version 1.6, but I've noticed a bug in the cdev >part that I can't seem to fix: if you pop up the hiermenu, then switch to >another cdev, then back to ZoomBar, the popup menu will eventually cause >a crash. It seems to think that the resources for the menu are still loaded >and valid, and chokes on invalid data. I DeleteMenu() the popup stuff, and >ReleaseResource() the handles, but that doesn't seem to make any difference. >I check if GetMenu() is returning a null handle (which it isn't, even before >it crashes). I'm using Think C 4.0.3, using their object-oriented cdev >starter. Any help will be much appreciated. I had exactly the same problems. I did the following which seems to have cured it: 1. Set the "System Heap" attribute on the menu if you are reading it in from a resouce. I happen to have also check "Preload", but that depends on what you do. 2. Lock the MenuHandle before calling PopUpMenuSelect. I don't know why this should help in the least. PopUpMenuSelect should know enough to not move memory while the handle is unlocked, but I have found circumstantial evidence to the contrary. I have tested neither of these moves to see why exactly they work. I just know that my cdev no longer crashes. Anyone seen any method behind this madness? pr -- Pete Resnick (...so what is a mojo, and why would one be rising?) Graduate assistant - Philosophy Department, Gregory Hall, UIUC System manager - Cognitive Science Group, Beckman Institute, UIUC Internet/ARPAnet/EDUnet : resnick@cogsci.uiuc.edu BITNET (if no other way) : FREE0285@UIUCVMD