Memory Leak on export png????

Richard Gaskin ambassador at fourthworld.com
Fri Mar 16 13:59:34 EDT 2007


Dave wrote:
> Please take a look at the handler copied below. This is an adaptation  
> of Ian Wood's "export snapshot.rev" stack that can be downloaded from  
> Rev Online.
> 
> I have changed in to use .png files instead of JPEG file, changed the  
> counter rectangle graphic object to have an all green background (RGB  
> = 0,255,0), I then select 500 iterations and press the "export from  
> snapshot from object" button, this writes 288 files and then gives an  
> execution error:
> 
> "export can't write to file, mask file or container  289.png"
> 
>   export snapshot from grp "counter" to file tDest as PNG
> 
> I also tried this without setting the background color and this does  
> write all 500 files, but RunRev crashes  (unexpectedly quits) doing  
> something unrelated a short while later. Also when this is running,  
> the first 50 to 100 files go quite quickly but after that it starts  
> to slow down.
> 
> Has anyone else seen this? I'm running on a Mac Pro, Mac OS 10.4.9  
> RunRev 2.8.0.350.

I simplified the script to make it easier to set up here, and since 
you're using v2.8 I removed the portion for earlier versions:


on mouseUp
   local tNum
   local twID
   local tFol
   local tDest

   put 500 into tNum
   put the windowID of this stack into twID
   put "/Users/rg/Desktop/untitled folder/" into tFol
   set the defaultfolder to tFol

   repeat with x = 1 to tNum
     if the mouse is down then
       exit to top
     end if
     put x & ".png" into tDest
     put x into fld "counter"
     export snapshot from grp 1 to file tDest as PNG
   end repeat
   answer "Done!"
end mouseUp

Running this script twice in both MC and Rev completed without error, 
and afterwards the memory allocation for each was roughly the same as 
before.

What suggests this crash is specifically a memory leak?

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com



More information about the use-livecode mailing list