home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / amiga / programm / 11830 < prev    next >
Encoding:
Text File  |  1992-07-30  |  1.3 KB  |  42 lines

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!USMCP6.BITNET!LOVEGA
  2. From: LOVEGA@USMCP6.BITNET (GREGORY LOVE)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: FreeRaster Causes a Guru.
  5. Message-ID: <920730.18052924.028224@USM.CP6>
  6. Date: 30 Jul 92 23:05:31 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Lines: 32
  9.  
  10. I'm having problems with this little snippet of code here.
  11. When I go to free the rasters, my machine Gurus as if I had
  12. tried to de-allocate un-allocated resources.
  13.  
  14. If I comment out the FreeRaster loop, the program works fine, but
  15. of course doesn't free up the memory for the rasters.
  16.  
  17. Any obvious mistakes on my part?
  18.  
  19. struct BitMap MyBitMap;
  20.  ...
  21.  ...
  22.  raswidth = 320;
  23.  rasheight = 200;
  24.  InitBitMap (&MyBitMap,numplanes,raswidth,rasheight);
  25.  for (i=0;i<numplanes;i++) {
  26.    if ((MyBitMap.Planes[i]=(PLANEPTR)AllocRaster(raswidth,rasheight))==NULL) {
  27.      MyExit ("Unable to allocate rasters.\n");
  28.    }
  29.  }
  30.  ...
  31.  ...
  32.  for (i=0;i<bitmapheader.nPlanes;i++) {
  33.    FreeRaster (MyBitMap.Planes[i],raswidth,rasheight);
  34.  }
  35.  
  36. Send mail to LOVEGA@USMCP6.BITNET (preferred)
  37.           or galove@seabass.st.usm.edu
  38.  
  39. I read this newsgroup, but I get it about a day late :).
  40.  
  41. * Gregory A. Love <LOVEGA@USMCP6.BITNET>, University of Southern Mississippi
  42.