memory leak in w95


[ Zettels Traum ] [ search / suche ]

von dp am 23.August 98 um 18:01:57:

zu: Director crashes under NT von dp am 07.Januar 98 um 21:13:12:

I have to report a dangerous memory leak that happens in Director for
windows 6.0.2 and 6.5 and WIN95:
Puppeting a shape sprite and replacing it by a bitmap, if the sprite has
a script that contains a "on mouseEnter" and the bitmap ends having a
matte ink, a memory leak will happen whenever you roll over the puppeted
sprite.

Here is how to reproduce it:

Create a new movie.

Create 4 members in castLib 1:
a field member named "FREEBYTES"
a rect shape member lets say a 100x100 pixels black rect (size doesn't
matter) named "RECT"
a bitmap member lets say a 100x100 pixels black circle (size doesn't
matter) named "BITMAP"
a button member named "SWITCH MEMBERS"

lets place this members on the score in frame 1:
sprite 1 : field "FREEBYTES"
sprite 2 : rect shape "RECT"
sprite 3 : button "SWITCH MEMBERS"

Now lets add some scripts:

movie script:
on idle
put the freebytes into field "FREEBYTES"
end

frame script for frame 1:
on exit frame
go to the frame
end

sprite script for sprite 3 (button "SWITCH MEMBERS"):
on mouseUp
set the member of sprite 2 to member "BITMAP" of castLib 1 -- replace
"RECT" by "BITMAP"
set the ink of sprite 2 to 8 -- matte ink, provokes memory leak !!!
end

sprite script for sprite 2 (rect shape "RECT"):
on mouseUp
beep
end
on mouseEnter
-- does nothing but provokes memory leak !!!
end

Play the movie.
OK, everything is fine, the freebytes are steady.
Click on the "SWITCH MEMBERS" button, the "BITMAP" replaces the "RECT"
(the placement doesn't matter).
Now when you roll over the "BITMAP" member and leave the mouse inside
it, you will see the freebytes
go down, down, down, until the thing crashs... By, by Director! Hello
Macromedia can you fix this please!

The memory leak will not happen if :
- you don't set the ink of sprite 2 to matte in script for sprite 3.
- you remove out the handler on mouseEnter in script for sprite 2. By
the way, as of memory leaking, on mouseWithin and on mouseLeave have the
same effect as on mouseEnter. Snif, mouse detection was a nice feature.

I tried this on 2 machines with DFW6.0.2 and DFW6.5 under WIN95. In both
machines, the leak happened, and beta testers of the cd-rom I just
finished reported that the application will sometimes slow down and die
after a few minutes, probably due to this bug.

Please try to reproduce this and if it doesn't happen mail me privately,
I will send you a test .DIR.

Regards

Jean
--
-------------------------------
INFOGRAPHIE
MULTIMEDIA
CONSEIL
FORMATION
-------------------------------
Jean JOURDAIN



Dazu:























D. Plänitz