[squeak-dev] Problem with image lock up with self error:
leves at elte.hu
Fri Jan 9 15:01:50 UTC 2015
It's because the error occurs in the critical section of AccessLock, so
it'll stay locked during error handling. This probably locks up the
debugger, because it can't access the preferences.
Here's a fix:
preferenceAt: aSymbol ifAbsent: aBlock
"Answer the Preference object at the given symbol, or the value of aBlock if not present"
self accessDictionaryOfPreferencesIn: [ :dictionaryOfPreferences |
ifPresent: [ :preference | ^preference ] ].
On Fri, 9 Jan 2015, karl ramberg wrote:
> Image lock up doing
> Preferences togglePreference: #justATest
> If I change error: to inform: in the method I do not get a image lock up.
> This is in a trunk image and tested with several Cog VM on Windows.
> Preferences>>togglePreference: prefSymbol
> "Toggle the given preference. prefSymbol must be of a boolean preference"
> (self preferenceAt: prefSymbol ifAbsent: [self error: 'unknown preference: ', prefSymbol]) togglePreferenceValue
More information about the Squeak-dev