home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / amiga / programm / 12972 < prev    next >
Encoding:
Text File  |  1992-09-01  |  2.5 KB  |  65 lines

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!ohstpy!miavx1!jwwalden
  2. Newsgroups: comp.sys.amiga.programmer
  3. Subject: FreeGadgets() causes Enforcer hit??
  4. Message-ID: <1992Sep1.175239.12472@miavx1.acs.muohio.edu>
  5. From: jwwalden@miavx1.acs.muohio.edu (P'relan)
  6. Date: 1 Sep 92 17:52:38 -0500
  7. Organization: Dept. of Physics
  8. Lines: 55
  9.  
  10. I have a bit of a problem with some code I'm working on, and hope someone on
  11. the net could help.  It seems that either I'm doing something wrong, or that
  12. asl.library's FreeGadgets() function is causing an Enforcer hit.  Here is the
  13. function in question:
  14.  
  15. void FreeWindow(struct Window *wind) {
  16.  
  17. struct Menu *men;
  18. struct Gadget *glist;
  19.  
  20. men = wind->MenuStrip;
  21. glist = wind->FirstGadget;
  22.  
  23. if (men) {
  24.         ClearMenuStrip(wind);
  25.         FreeMenus(men);
  26.         }
  27. CloseWindow(wind);
  28. if (glist) FreeGadgets(glist);   <----- This line causes hit.
  29. }
  30.  
  31.  
  32. As you can see, this function is simply meant to close a window and free all
  33. associated GadTools resources.  However, when it is executed the FreeGadgets()
  34. line causes two enforcer hits.  Note that I'm running MungWall, Enforcer, and
  35. Sushi.  Sushi output as follows:
  36.  
  37. Program Counter (approximate)=  FB87F4        Fault address       =DEADBEEF
  38. User stack pointer           =  331D0C        DOS process address =  2F68E8
  39. Data: DEADBEEF 00200010 000003ED 002F7C5C 00000001 00000000 00000032 FFFFFF9C
  40. Addr: DEADBEEF 003711B0 003711FC DEADBEEF 0025BF32 00331D24 0025BF00 002021A8
  41. Stck: 003711FC 003730B8 00309510 0025BF00 DEADBEEF 00FEB80A 00331D40 00328B68
  42. READ-LONG  (---)(-)(-)    SR=0018   SSW=0141
  43. Background CLI, "RAM_Disk:ms/master"
  44.  
  45. Program Counter (approximate)=  FB87FA        Fault address       =DEADBEFF
  46. User stack pointer           =  331D0C        DOS process address =  2F68E8
  47. Data: DEADBEEF 00200010 000003ED 002F7C5C 00000001 00000000 00000032 FFFFFF9C
  48. Addr: 00000000 003711B0 003711FC DEADBEEF 0025BF32 00331D24 0025BF00 002021A8
  49. Stck: 003711FC 003730B8 00309510 0025BF00 00000000 00FEB80A 00331D40 00328B68
  50. READ-BYTE  (---)(-)(-)    SR=0014   SSW=0151
  51. Background CLI, "RAM_Disk:ms/master"
  52.  
  53.  
  54. It looks like the program is using freed memory, since DEADBEEF is the value
  55. MungWall fills freed memory with, but I have no idea why.  Am I doing something
  56. wrong?  Is there a bug in FreeGadgets()?  All help appreciated.
  57.  
  58. Thanks.
  59.  
  60.  
  61. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  62.  P'relan (and Birith)             ``Time stand still -
  63.  jwwalden@miavx1.acs.muohio.edu      I'm not looking back -
  64.   or jwwalden@miavx1.bitnet         But I want to look around me now.'' - RUSH
  65.