Hi Horrido. Morphic is not thread safe library. Users should not update morphs state directly from background processes. Use #defer: message to update morphs in such cases. Try following loop: [ [ true ] whileTrue: [ UIManager default defer: [ a contents: 0 asString]. delay wait ] fork 2017-05-31 16:23 GMT+02:00 horrido <horrido.hobbies@gmail.com>:
I have a puzzling bug. I've narrowed the scenario down to this code:
Cranky»initA a := ((StringMorph contents: '####') color: Color white) position: (0@0 ). m addMorph: a
Cranky»initialize f := Form fromFileNamed: 'hot_air_balloon_mysticmorning.jpg'. m := ImageMorph new. m form: f. self initA. m openInWindowLabeled: 'Cranky'. delay := (Delay forSeconds: 5). [ [ true ] whileTrue: [ a contents: 0 asString. delay wait ] fork
I can run this application for hours and hours with no problem. However, if I run it for a while and then close the application and then save/exit the image, the next time I start the image, there is some likelihood it will crash dump. The probability is something like 5-10%.
Interestingly, if I remove the statement...
a contents: 0 asString.
from the infinite loop, I've not been able to replicate the crash. Is there something wrong with the way I'm updating the contents of the StringMorph?
-- View this message in context: http://forum.world.st/Morphic- or-forking-bug-tp4948727.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.