On Wed, May 31, 2017 at 10:23 PM, horrido <horrido.hobbies@gmail.com> wrote:
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?
Can you try a few other variations... [ [ true ] whileTrue: [ 0 asString. delay wait ] fork. [ [ true ] whileTrue: [ a contents: '0'. delay wait ] fork. [ [ true ] whileTrue: [ a contents: '0'. ] forkAt: 20. cheers -ben