I share the same color table throughout many uses, and wasn't aware that
DisposeGWorld would do anything with my color table that I passed to
NewGWorld. It should deallocate the GDevice it created, the Pixmap bits,
I am not using resources for color tables; they are all created in the
initialization phase of my program using NewHandle() and were filled in by
my custom code. It appears that only the 8-bit DisposeGWorld is killing my
machine.
I do a lot of 8-bit mask manipulation in GWorlds, and I set up a grayscale
color table at the beginning of my program, and use it throughout.
For some reason this particular DisposeGWorld is causing my program fits.
If I comment out the DisposeGWorld, and let the memory leak, the code works
okay.
After calling DisposeGWorld, my program eventually crashes in some later
call to CopyBits.
I thought perhaps that I was drawing into a disposed GWorld, but I don't
think so. The bad things happen in both Classic and Carbon. In carbon, I
eventually get a protection violation with tracing such as this:
Thread 0 Crashed:
#0 0x91a59e84 in SetupOffscreenDevice
#1 0x91a53f18 in Stretch
#2 0x91a5f168 in OneSrcOneDst
#3 0x91a59a90 in BitsDevLoop
#4 0x91a53868 in CommonBits
#5 0x91a59c88 in CopyBits <=== the entry into the toolbox
#6 0x0027fef0 in Pix_To_Pix
#7 0x001e86c8 in Apply_Subset
#8 0x001ea0d4 in 0x1ea0d4
#9 0x001eb3bc in Cache_Get2
#10 0x001eb8a8 in Cache_Get
#11 0x00292f18 in Photo_Calc_DstBox
#12 0x00292cb4 in Photo_Paste
#13 0x002c49d4 in Pack_OK
#14 0x00242ab4 in OneShot_Click
#15 0x0023b628 in Intf_MouseDown
#16 0x001d9f1c in Human_MouseDown
#17 0x001da78c in Main_Event_Handler
#18 0x001dab60 in Main_Loop
#19 0x001db31c in Do_Main
#20 0x001d90e0 in Discus
#21 0x003298b0 in 0x3298b0
#22 0x902790c4 in CCFM_LaunchApplication
#23 0x0000362c in main
#24 0x0000329c in _start
#25 0x0000311c in start
>> Stay informed about: Help! DisposeGWorld is killing me!