That dump looks familiar..
----
| surface morph formCanvas |
surface := AthensCairoSurface extent: 100@100.
surface drawDuring: [ :athCan |
athCan
setShape: (0 asPoint corner: 100 asPoint);
setPaint: Color orange;
draw.
].
morph := surface asForm asMorph.
"comment out these two lines, and it draws fine"
surface := nil.
Smalltalk garbageCollect.
formCanvas := FormCanvas extent: 100 asPoint.
morph fullDrawOn: formCanvas .
morph debugDrawError
---
AthensCairoCanvas >>#asForm do not actually return a "valid" form, but an
"external" that holds an index to a Surface, instead of the actual bits, and
somewhere during drawing there is a machinery which finds the surface based
on this index, and copy those bits. That way #asForm do not need to allocate
any bits itself, but at the expense that the lifetime of the surface must be
longer then the form.
I guess you can try to use AthensCairoSurface>>#displayOnMorphicCanvas:at:
in TRMorph>>#drawOn: instead of how it is done now, this should assure that
the Surface is still alive when drawing.
I also think that changing the extent of the surface should be moved from
#layoutChanged to the start of #drawOn:. The layoutChanged/ morph extent
change could happen more than once in between draw calls, which could cause
unnecessary recreations of the surface. It should also ensure that the
surface cannot be recreated while inside #drawOn:.
Hope this helps.
Best regards,
Henrik
--
View this message in context:
http://forum.world.st/VM-Crash-tp4905304p4905497.html
Sent from the Moose mailing list archive at
Nabble.com.