home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!ohstpy!miavx1!jwwalden
- Newsgroups: comp.sys.amiga.programmer
- Subject: FreeGadgets() causes Enforcer hit??
- Message-ID: <1992Sep1.175239.12472@miavx1.acs.muohio.edu>
- From: jwwalden@miavx1.acs.muohio.edu (P'relan)
- Date: 1 Sep 92 17:52:38 -0500
- Organization: Dept. of Physics
- Lines: 55
-
- I have a bit of a problem with some code I'm working on, and hope someone on
- the net could help. It seems that either I'm doing something wrong, or that
- asl.library's FreeGadgets() function is causing an Enforcer hit. Here is the
- function in question:
-
- void FreeWindow(struct Window *wind) {
-
- struct Menu *men;
- struct Gadget *glist;
-
- men = wind->MenuStrip;
- glist = wind->FirstGadget;
-
- if (men) {
- ClearMenuStrip(wind);
- FreeMenus(men);
- }
- CloseWindow(wind);
- if (glist) FreeGadgets(glist); <----- This line causes hit.
- }
-
-
- As you can see, this function is simply meant to close a window and free all
- associated GadTools resources. However, when it is executed the FreeGadgets()
- line causes two enforcer hits. Note that I'm running MungWall, Enforcer, and
- Sushi. Sushi output as follows:
-
- Program Counter (approximate)= FB87F4 Fault address =DEADBEEF
- User stack pointer = 331D0C DOS process address = 2F68E8
- Data: DEADBEEF 00200010 000003ED 002F7C5C 00000001 00000000 00000032 FFFFFF9C
- Addr: DEADBEEF 003711B0 003711FC DEADBEEF 0025BF32 00331D24 0025BF00 002021A8
- Stck: 003711FC 003730B8 00309510 0025BF00 DEADBEEF 00FEB80A 00331D40 00328B68
- READ-LONG (---)(-)(-) SR=0018 SSW=0141
- Background CLI, "RAM_Disk:ms/master"
-
- Program Counter (approximate)= FB87FA Fault address =DEADBEFF
- User stack pointer = 331D0C DOS process address = 2F68E8
- Data: DEADBEEF 00200010 000003ED 002F7C5C 00000001 00000000 00000032 FFFFFF9C
- Addr: 00000000 003711B0 003711FC DEADBEEF 0025BF32 00331D24 0025BF00 002021A8
- Stck: 003711FC 003730B8 00309510 0025BF00 00000000 00FEB80A 00331D40 00328B68
- READ-BYTE (---)(-)(-) SR=0014 SSW=0151
- Background CLI, "RAM_Disk:ms/master"
-
-
- It looks like the program is using freed memory, since DEADBEEF is the value
- MungWall fills freed memory with, but I have no idea why. Am I doing something
- wrong? Is there a bug in FreeGadgets()? All help appreciated.
-
- Thanks.
-
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- P'relan (and Birith) ``Time stand still -
- jwwalden@miavx1.acs.muohio.edu I'm not looking back -
- or jwwalden@miavx1.bitnet But I want to look around me now.'' - RUSH
-