Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!apple!nerm From: nerm@Apple.COM (Dean Yu) Newsgroups: comp.sys.mac.programmer Subject: Re: DisposeMenu vs. ReleaseResource Keywords: mac, programming, toolbox, menu, resource Message-ID: <52260@apple.Apple.COM> Date: 1 May 91 18:53:00 GMT References: <1991May1.005649.27669@world.std.com> Organization: Apple Computer Inc., Cupertino, CA Lines: 21 In article <1991May1.005649.27669@world.std.com> barry@world.std.com (Barry L Wolman) writes: >I'm incorporating some code written by someone else into a project I'm >doing. That code assumes that it can use DisposeMenu when it's through >with a menu. However, many of the menus with which it will deal will >have been read from the resource file. Inside Mac says to use >ReleaseResource to get rid of menus read from resource files and to >use DisposeMenu for menus created by NewMenu. IM doesn't say what >happens if you call DisposeMenu on a menu read from a resource file. >Should I add some code to check what type of menu is involved and >make the appropriate call? What (bad?) happens if I just let it >always call DisposeMenu. > _DisposeMenu does the right thing, so it's ok to always call it to get rid of a menu. Looking at the dates in the source, it's been like this since the 128K ROMs. And I know that we touched it up a bit for System 7. -- Dean Yu Blue Meanie, Negative Ethnic Role Model, etc. Apple Computer, Inc. My opinions and so on and so forth...