Re: Akua Sweets "the image from" memory leak?
Re: Akua Sweets "the image from" memory leak?
- Subject: Re: Akua Sweets "the image from" memory leak?
- From: David Blache <email@hidden>
- Date: Wed, 22 Nov 2000 19:15:10 -0600
For anyone interested:
For some reason, Akua Sweets "the image from" command defaults to returning
a proxy by default.
AFAICT, a "proxy" is just a fancy word for leaving a copy of the image in
memory with no way to release it! I can't see why this default behavior was
chosen, or why this default behavior is a better choice than returning the
real image data. Can someone enlighten me?
To force Akua Sweets to give you the real image data without leaving an
unrecoverable copy in memory, you have to use the "without proxy return"
parameter:
set myImage to the image from myFile without proxy return
^^^^^^^^^^^^^^^^^^^^
set myImage to nothing -- and now it's released from the heap!
-David
on 11/22/2000 6:30 PM, David Blache wrote:
>
Hi folks,
>
>
The following script, saved as an application, will leak memory until the
>
entire heap is full. I can't figure out a way to get Akua Sweets to dispose
>
of the image in the application heap.
>
>
Is this my fault, or Akua Sweets???
>
>
-- start script
>
-- save as stay-open classic applet
>
property myFile : ""
>
property myImage : ""
>
>
on run
>
set myFile to choose file
>
end run
>
>
on idle
>
-- set myImage to the image from myFile
>
set myImage to a reference to the image from myFile
>
set myImage to nothing
>
return 1
>
end idle
>
>
on quit
>
set myImage to nothing
>
continue quit
>
end quit
>
-- end script
>
>
Any suggestions?
>
>
-David