View Issue Details

IDProjectCategoryView StatusLast Update
0003349NoesisGUIC++ SDKpublic2024-06-05 17:12
ReporterAnKor Assigned Tosfernandez  
PrioritynormalSeveritycrash 
Status resolvedResolutionfixed 
Product Version3.2 
Target Version3.2.4Fixed in Version3.2.4 
Summary0003349: Crash when re-evaluating style triggers while IView is being destroyed
Description

Found an access violation crash which always happen.

An item inside list box has a style that:

  • sets a binding referencing ListBox ancestor to a property;
  • has a trigger with a setter to the same property;
  • trigger condition also references ListBox ancestor;
  • trigger condition is true just before destroying the view.

My guess is that during IView destruction the condition gets re-evaluated and becomes false.
This causes the original property setter to become active, but its binding seems to reference the already dead listbox.

While this example reproduces the crash during IView destruction, I may have stumbled upon it in other scenarios as well - when only a part of the element tree was being removed, but I'm not 100% sure.

Steps To Reproduce

Using "Buttons" example, add this code into MainWindow.xaml, then run and close the application. There will be an access violation error deep in the code called by ~IView()

<ListBox>
<ListBoxItem Content="Item">
<ListBoxItem.Style>
<Style TargetType="ListBoxItem">
<Setter Property="Tag" Value="{Binding Tag, RelativeSource={RelativeSource AncestorType=ListBox}}" />
<Style.Triggers>
<DataTrigger Binding="{Binding Visibility, RelativeSource={RelativeSource AncestorType=ListBox}}" Value="Visible">
<Setter Property="Tag" Value="" />
</DataTrigger>
</Style.Triggers>
</Style>
</ListBoxItem.Style>
</ListBoxItem>
</ListBox>

This seems to be reproducible even in XamlToy which shows nothing every other attempt to run this xaml.

PlatformAny

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2024-05-28 22:44 AnKor New Issue
2024-05-29 15:13 jsantos Assigned To => sfernandez
2024-05-29 15:13 jsantos Status new => assigned
2024-05-29 15:13 jsantos Target Version => 3.2.4
2024-06-05 17:12 sfernandez Status assigned => resolved
2024-06-05 17:12 sfernandez Resolution open => fixed
2024-06-05 17:12 sfernandez Fixed in Version => 3.2.4