home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!USMCP6.BITNET!LOVEGA
- From: LOVEGA@USMCP6.BITNET (GREGORY LOVE)
- Newsgroups: comp.sys.amiga.programmer
- Subject: FreeRaster Causes a Guru.
- Message-ID: <920730.18052924.028224@USM.CP6>
- Date: 30 Jul 92 23:05:31 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Lines: 32
-
- I'm having problems with this little snippet of code here.
- When I go to free the rasters, my machine Gurus as if I had
- tried to de-allocate un-allocated resources.
-
- If I comment out the FreeRaster loop, the program works fine, but
- of course doesn't free up the memory for the rasters.
-
- Any obvious mistakes on my part?
-
- struct BitMap MyBitMap;
- ...
- ...
- raswidth = 320;
- rasheight = 200;
- InitBitMap (&MyBitMap,numplanes,raswidth,rasheight);
- for (i=0;i<numplanes;i++) {
- if ((MyBitMap.Planes[i]=(PLANEPTR)AllocRaster(raswidth,rasheight))==NULL) {
- MyExit ("Unable to allocate rasters.\n");
- }
- }
- ...
- ...
- for (i=0;i<bitmapheader.nPlanes;i++) {
- FreeRaster (MyBitMap.Planes[i],raswidth,rasheight);
- }
-
- Send mail to LOVEGA@USMCP6.BITNET (preferred)
- or galove@seabass.st.usm.edu
-
- I read this newsgroup, but I get it about a day late :).
-
- * Gregory A. Love <LOVEGA@USMCP6.BITNET>, University of Southern Mississippi
-