Comments (4)
Thanks for reporting. Is there a way you can provide this in a (failing) unit test format? Then we can try to embed the tests into catel and fix if possible.
from catel.
Will try to cook something up when I am done with removing that default constructor.
from catel.
Unfortunately, I can't reproduce the issue in a simplified test case, so maybe close this issue?
Looking at the catel source, though, something seems a little odd to me:
In ServiceLocatorExtensions.TryResolveType, the "this" (the service locator itself) is used as a lock object.
In ServiceLocator.IsTypeRegisteredInCurrentLocator, the dedicated internal lock object is used as a lock.
How can this result in a deadlock? Do you understand what is happening here?
What's the reason for locking in the extension method at all? That lock should not prevent anyone from removing the type between the check for registration and the attempt at object creation, as that method is using a different lock.
But this lock will result in a deadlock if some object that is created while resolving calls TryResolveType from a different thread in the constructor (for example because of GUI depending code). So, if you don't mind that I am wasting your time more than I already did, what scenario is the lock in the extension method supposed to avoid?
Thanks!
from catel.
Great find about the lock in the service locator. I've removed the lock (it's not needed). We also worked on a fix that was caused by the ConfigurationService (took us a while to figure out). We will release a new alpha with the fixes soon.
from catel.
Related Issues (20)
- question.is it possible to use with prism. HOT 1
- Injecting IAuthenticationProvider does not affect Commands HOT 1
- Allow serialization of Classes implementing IDictionary<TKey,TValue> HOT 1
- Consider specifying Foreground Color in InfoBarMessageControl HOT 7
- [ ] WPF d:DataContent compile error HOT 2
- Implement nullable support HOT 1
- Serializer trapped in endless loop when deserializing HOT 2
- Remove unnecessary references for netfx(net4x) targets HOT 2
- Removing a ChildViewModel does not re-validate the ParentViewModel HOT 2
- Cannot deserialize model from encrypted string
- StringToObjectHelper.ToRightType returns wrong values for type byte HOT 2
- Duplicate subscription to window completed callback in UIVisualizerService
- Change Execute and CanExecute methods for CommandContainerBase to public
- "Serializing delegates is not supported on this platform" exception in ChildAwareModelBase.BeginEdit method HOT 4
- Remove TypeExtensions.IsSerializableEx
- Disable TypeCache reflection only checks
- Prevent duplicate property change notification when using ViewModelToModel attribute on models that don't check for equality before raising HOT 2
- Validation for UserControl problems
- CacheStorage should not enable auto expiration by default without default policy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from catel.