pharo
pharo copied to clipboard
Dropping an external file, click on Cancel and get a debugger
To Reproduce
Steps to reproduce the behavior:
- Go to OS file browser
- Drag a .st file into the Pharo IDE to see the dialog with 2 options
- Press on Cancel
- See "Instance of DefaultExternalDropHandler did not understand #morphicUIManager" titled debugger
Expected behavior Nothing should happen after selecting Cancel.
Screenshots
Screen recording:
Version information:
Pharo 12.0.0 Build information: Pharo-12.0.0+SNAPSHOT.build.1510.sha.7efef560919a459de9e2fad384ee4614fdcb1691 (64 Bit)
I think the problem comes from (some?) Morphic step methods are processed twice:
runStepMethodsIn: aWorld
"Perform periodic activity inbetween event cycles"
| queue nextInQueue|
"If available dispatch some deferred UI Message"
queue := self deferredUIMessages.
[(nextInQueue := queue nextOrNil) isNil]
whileFalse: [ nextInQueue value].
self runLocalStepMethodsIn: aWorld.
"The multi-threaded global Transcript needs to be updated periodically and synchronously with the UI."
Smalltalk tools transcript stepGlobal
It seems that the current implementation of WaitfreeQueue>>#nextOrNilSuchThat: does not remove zombie items from the queue, which can lead to processing them twice.
- One solution could be removing zombie items from the queue as we encounter them.
- Another one could be ensuring that
makeCircularis atomic, but I don't know if it is related.
Related to #17480