-
-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fluent Ribbon crashes program on shutdown #489
Comments
Will have a look this weekend. |
According to the stacktrace i doubt this happens on startup as the stack show that this happens when the backstage is unloaded and it's adorner is destroyed. Do you show the backstage or startscreen on application startup? |
You're right, it's not always start-up. I see that sometimes it happens 2 seconds after a user starts up the program. Other times, it happens after the user has had the program open for a long time. Unfortunately, there doesn't seem to be an obvious pattern. |
I just spoke with one of my users that is experiencing this problem. It happens while she's in the middle using the program (not when it's starting up or shutting down). It's been a bit disruptive for her. There's another user that uses the same program just as much, but he hasn't experienced the problem at all. Of course, he could be using the program differently. |
I have an idea that might fix this problem. In Backstage.cs, in the DestroyAdorner function, I'm going to try surrounding the call to layer?.Remove(this.adorner); with a call to Dispatcher.DisableProcessing() |
Well, that didn't work. After some more investigation, I figured out that the crash actually happens when the program starts up (contrary to what my users were reporting). I tried shutting down the dispatcher on program shutdown, but that didn't prevent the problem. Ultimately, this is what I think I'll do: In the DestroyAdorner function in Backstage.cs, ignore errors when the program is shutting down:
And I will call this when the program begins to shut down (which will run before the code shown above): Application.Current.Dispatcher.InvokeShutdown(); It's not pretty, but it should work. I don't care if there is an error dismantling the UI when I'm shutting down the program. It would be nice to have the underlying problem fixed, of course. |
May i guess that the application is shut down by clicking a backstage button? |
Yes, that is one way the user can close the program. Sounds like you have an idea about what's wrong. |
I think it's the WPF animation system that causes this issue. |
Hi,
I recently upgraded from a much older version of the Fluent Ribbon bar, and some of my users have started getting program crashes in my crash log. So far, I have been unable to reproduce this problem on my own computer. I've seen it happen (to my boss!!!) when he was using the program on a terminal server. It's also happening to a few other users, but I don't know their exact circumstances. Hopefully the stack trace (which I collect whenever there is an unhandled exception) will help. The problem seems to happen as the program is starting up and the main Fluent Ribbon window is just appearing.
Do you think I should try using the latest beta version (available as a Nuget package)?
Thanks!
Steven
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Windows.DeferredAppResourceReference.GetValue(BaseValueSourceInternal valueSource)
at System.Windows.DependencyPropertyChangedEventArgs.get_OldValue()
at System.Windows.Controls.Control.OnTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
at System.Windows.StyleHelper.InvalidateResourceDependents(DependencyObject container, ResourcesChangeInfo info, FrugalStructList
1& resourceDependents, Boolean invalidateVisualTreeToo) at System.Windows.TreeWalkHelper.InvalidateStyleAndReferences(DependencyObject d, ResourcesChangeInfo info, Boolean containsTypeOfKey) at System.Windows.TreeWalkHelper.OnResourcesChanged(DependencyObject d, ResourcesChangeInfo info, Boolean raiseResourceChangedEvent) at System.Windows.FrameworkElement.OnAncestorChangedInternal(TreeChangeInfo parentTreeState) at System.Windows.TreeWalkHelper.OnAncestorChanged(DependencyObject d, TreeChangeInfo info, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker
1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree)at MS.Internal.PrePostDescendentsWalker
1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker
1.VisitNode(FrameworkElement fe, Boolean visitedViaVisualTree)at System.Windows.DescendentsWalker
1.VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker
1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)at System.Windows.DescendentsWalker
1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker
1.IterateChildren(DependencyObject d)at System.Windows.DescendentsWalker
1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at MS.Internal.PrePostDescendentsWalker
1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree)at System.Windows.DescendentsWalker
1.VisitNode(FrameworkElement fe, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker
1.VisitNode(DependencyObject d, Boolean visitedViaVisualTree)at System.Windows.DescendentsWalker
1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren) at System.Windows.DescendentsWalker
1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)at System.Windows.DescendentsWalker
1.IterateChildren(DependencyObject d) at System.Windows.DescendentsWalker
1.StartWalk(DependencyObject startNode, Boolean skipStartNode)at MS.Internal.PrePostDescendentsWalker
1.StartWalk(DependencyObject startNode, Boolean skipStartNode) at System.Windows.TreeWalkHelper.InvalidateOnTreeChange(FrameworkElement fe, FrameworkContentElement fce, DependencyObject parent, Boolean isAddOperation) at System.Windows.FrameworkElement.OnVisualParentChanged(DependencyObject oldParent) at System.Windows.Media.Visual.FireOnVisualParentChanged(DependencyObject oldParent) at System.Windows.Media.Visual.RemoveVisualChild(Visual child) at System.Windows.FrameworkElement.set_TemplateChild(UIElement value) at System.Windows.StyleHelper.ClearGeneratedSubTree(HybridDictionary[] instanceData, FrameworkElement feContainer, FrameworkContentElement fceContainer, FrameworkTemplate oldFrameworkTemplate) at System.Windows.StyleHelper.DoTemplateInvalidations(FrameworkElement feContainer, FrameworkTemplate oldFrameworkTemplate) at System.Windows.Controls.Control.OnTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue) at System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject container, FrugalStructList
1& exclusionContainerDependents, FrugalStructList1& oldContainerDependents, FrugalStructList
1& newContainerDependents)at System.Windows.StyleHelper.DoStyleInvalidations(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle)
at System.Windows.StyleHelper.UpdateStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle, Style& styleCache)
at System.Windows.FrameworkElement.OnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
at System.Windows.FrameworkElement.UpdateStyleProperty()
at System.Windows.TreeWalkHelper.InvalidateStyleAndReferences(DependencyObject d, ResourcesChangeInfo info, Boolean containsTypeOfKey)
at System.Windows.TreeWalkHelper.OnResourcesChanged(DependencyObject d, ResourcesChangeInfo info, Boolean raiseResourceChangedEvent)
at System.Windows.FrameworkElement.OnAncestorChangedInternal(TreeChangeInfo parentTreeState)
at System.Windows.TreeWalkHelper.OnAncestorChanged(DependencyObject d, TreeChangeInfo info, Boolean visitedViaVisualTree)
at System.Windows.DescendentsWalker
1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at MS.Internal.PrePostDescendentsWalker
1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree)at System.Windows.DescendentsWalker
1.VisitNode(FrameworkElement fe, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker
1.VisitNode(DependencyObject d, Boolean visitedViaVisualTree)at System.Windows.DescendentsWalker
1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker
1.IterateChildren(DependencyObject d)at System.Windows.DescendentsWalker
1.StartWalk(DependencyObject startNode, Boolean skipStartNode) at MS.Internal.PrePostDescendentsWalker
1.StartWalk(DependencyObject startNode, Boolean skipStartNode)at System.Windows.TreeWalkHelper.InvalidateOnTreeChange(FrameworkElement fe, FrameworkContentElement fce, DependencyObject parent, Boolean isAddOperation)
at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
at System.Windows.FrameworkElement.RemoveLogicalChild(Object child)
at System.Windows.Documents.AdornerLayer.Remove(Adorner adorner)
at Fluent.Backstage.DestroyAdorner()
at Fluent.Backstage.OnBackstageUnloaded(Object sender, RoutedEventArgs e)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastUnloadedEvent(Object root)
at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Environment
The text was updated successfully, but these errors were encountered: