View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002872 | NoesisGUI | Unity | public | 2023-11-22 15:58 | 2024-01-28 17:19 |
| Reporter | Kirkules | Assigned To | jsantos | ||
| Priority | normal | Severity | crash | ||
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.2.2 | ||||
| Target Version | 3.2.3 | Fixed in Version | 3.2.3 | ||
| Summary | 0002872: Crash on Quit App | ||||
| Description | macOS 14.1.1 (23B81) Cinemacine 3.0.0-pre.9 Identifier: com.adx.yo Date/Time: 2023-11-22 09:49:49.3786 -0500 Sleep/Wake UUID: 375750F4-70B3-4253-835D-64535A93CB5A Time Awake Since Boot: 32000 seconds System Integrity Protection: enabled Crashed Thread: 0 tid_103 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 VM Region Info: 0x132c741a0 is not in any region. Bytes after previous region: 5923233 Bytes before following region: 19447392 Thread 0 Crashed:: tid_103 Dispatch queue: com.apple.main-thread | ||||
| Steps To Reproduce | Run app | ||||
| Platform | macOS | ||||
|
What version of Noesis is this? Is this reproducing in our examples on a clean project? |
|
|
3.2 |
|
|
3.2.2 ? |
|
|
Yes, 3.2.2, sorry. Just confirmed happens in clean project with the same xaml files from original project. |
|
|
Could you please try with one of the examples included in the package? (HelloWorld, Buttons...) |
|
|
Buttons, Tic-Tac-Toe both worked, no crash in player after exit! StartMPGameViewModel.cs (4,343 bytes)
#region Using Directives
using System ;
using System.Collections.Generic ;
using System.ComponentModel ;
using System.Runtime.CompilerServices ;
using System.Windows.Input;
//using Fury.Game.NoesisUI;
//using Noesis;
//using Unity.Entities;
using UnityEngine ;
using EventHandler = System.EventHandler;
#endregion
namespace Fury.UI.Windows
{
public enum ConnectionMode : byte { Client, Host, };
public class StartMPGameViewModel : INotifyPropertyChanged
{
[SerializeField] public string PlayerName { get; set; }
[SerializeField] public string IPString { get; set; }
[SerializeField] public string PortString { get; set; }
[SerializeField] public bool IsSpectator { get; set; }
[SerializeField] public ConnectionMode ConnectionMode { get; set; }
private bool _isHostSelected;
private bool _isClientSelected;
private bool _spectatorEnabled;
public StartMPGameViewModel()
{
this.PlayerName = "Player";
this.IPString = "127.0.0.1";
this.PortString = "7777";
this.SpectatorEnabled = false;
this.ConnectionMode = ConnectionMode.Host;
CancelCommand = new DelegateCommand(SayCancelled); // Link the command to the method
StartCommand = new DelegateCommand(StartGame);
}
public bool SpectatorEnabled
{
get => _spectatorEnabled;
set
{
_spectatorEnabled = value;
IsSpectator = value;
//Debug.Log($"Spectator Mode = {_spectatorEnabled}");
}
}
public bool IsJoinSelected
{
get => _isClientSelected;
set
{
_isClientSelected = value;
//Debug.Log($"IsJoinSelected = {_isClientSelected}");
}
}
public bool IsHostSelected
{
get => _isHostSelected;
set
{
_isHostSelected = value;
//Debug.Log($"IsHostSelected = {_isHostSelected}");
}
}
// Bind "Command={Binding CancelCommand}" to a button in the XAML
// Custom DelegateCommand class defined below: taken from https://www.noesisengine.com/docs/Gui.Core.CommandsTutorial.html#command-bindings
public DelegateCommand CancelCommand { get; set; }
public DelegateCommand StartCommand { get; set; }
// TODO: hacky?
private void StartGame(object parameter)
{
//if (IsHostSelected)
//{
// World.DefaultGameObjectInjectionWorld.GetOrCreateSystemManaged<NoesisUISystem>().HostButtonPressed();
//}
//else if (IsJoinSelected)
//{
// World.DefaultGameObjectInjectionWorld.GetOrCreateSystemManaged<NoesisUISystem>().JoinButtonPressed();
//}
//else
{
Debug.Log($"<color=green>{parameter} Select either Host or Join!</color>");
}
}
private void SayCancelled(object parameter)
{
Debug.Log($"{parameter} Cancelled!");
}
#region DelegateCommand Implementation
public class DelegateCommand : ICommand
{
public DelegateCommand(Action<object> execute)
{
if (execute == null)
{
throw new ArgumentNullException("execute");
}
_execute = execute;
}
public DelegateCommand(Func<object, bool> canExecute, Action<object> execute)
{
if (canExecute == null)
{
throw new ArgumentNullException("canExecute");
}
if (execute == null)
{
throw new ArgumentNullException("execute");
}
_canExecute = canExecute;
_execute = execute;
}
public bool CanExecute(object parameter)
{
return _canExecute == null || _canExecute(parameter);
}
public void Execute(object parameter)
{
_execute(parameter);
}
public event EventHandler CanExecuteChanged;
public void RaiseCanExecuteChanged()
{
if (CanExecuteChanged != null)
{
CanExecuteChanged(this, System.EventArgs.Empty);
}
}
private Func<object, bool> _canExecute;
private Action<object> _execute;
}
#endregion
#region INotifyPropertyChanged Implementation
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(field, value))
return false;
field = value;
OnPropertyChanged(propertyName);
return true;
}
#endregion
}
} StartMPGameControl.xaml (11,217 bytes)
<UserControl
x:Class="Fury.UI.Windows.StartMPGameControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Name="root"
mc:Ignorable="d"
d:DesignWidth="1920" d:DesignHeight="1080">
<UserControl.Resources>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0" x:Key="GrayGradient">
<GradientStop Color="#FF3F3F3F" Offset="1.0" />
<GradientStop Color="#FFBFBFBF" Offset="0.0" />
</LinearGradientBrush>
<LinearGradientBrush EndPoint="1,1" StartPoint="0,0" x:Key="DarkBlueGradient">
<GradientStop Color="#FF1E3C72" Offset="0.0" />
<GradientStop Color="#FF2A8DEF" Offset="1.0" />
</LinearGradientBrush>
<LinearGradientBrush EndPoint="1,1" StartPoint="0,0" x:Key="DarkRedGradient">
<GradientStop Color="DarkRed" Offset="0.0" />
<GradientStop Color="Salmon" Offset="1.0" />
</LinearGradientBrush>
<ControlTemplate TargetType="{x:Type Button}" x:Key="CoolBtnTemplate">
<Grid>
<Rectangle
Fill="{TemplateBinding Background}"
Stroke="Silver"
StrokeThickness="2"
x:Name="Rect" />
<ContentPresenter
Content="{TemplateBinding Content}"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Stroke" TargetName="Rect" Value="Yellow" />
<Setter Property="Fill" TargetName="Rect" Value="Orange" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Stroke" TargetName="Rect" Value="Green" />
<Setter Property="Fill" TargetName="Rect" Value="PaleGreen" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style
TargetType="TextBlock"
x:Key="HeaderText1"
x:Name="HeaderTextStyle1">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Margin" Value="2" />
<Setter Property="FontSize" Value="38" />
<Setter Property="FontWeight" Value="Black" />
<Setter Property="Foreground" Value="DarkBlue" />
</Style>
<Style
TargetType="TextBlock"
x:Key="HeaderText2"
x:Name="HeaderTextStyle2">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="4" />
<Setter Property="FontSize" Value="28" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="White" />
</Style>
<Style
TargetType="Border"
x:Key="SectionBorder"
x:Name="SectionBorderStyle">
<Setter Property="BorderThickness" Value="2.8" />
<Setter Property="BorderBrush" Value="Silver" />
<Setter Property="Margin" Value="8,8,8,16" />
</Style>
</UserControl.Resources>
<Viewbox HorizontalAlignment="Center" VerticalAlignment="Center">
<StackPanel
Background="{StaticResource GrayGradient}"
Height="Auto"
HorizontalAlignment="Left"
Margin="8"
TextElement.Foreground="White"
VerticalAlignment="Top"
Width="Auto">
<StackPanel.Resources>
<ControlTemplate x:Key="LabeledField">
<Grid Height="Auto" Width="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="128" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
FontFamily="Arial Black"
FontSize="16pt"
FontWeight="Bold"
Foreground="White"
Grid.Column="0"
Text="{Binding Content, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ContentControl}}}"
VerticalAlignment="Center" />
<TextBox
FontSize="24pt"
Grid.Column="1"
VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
<Style TargetType="{x:Type ContentControl}" x:Key="LabeledFieldStyle">
<Setter Property="Template" Value="{StaticResource LabeledField}" />
</Style>
</StackPanel.Resources>
<TextBlock Style="{StaticResource HeaderText1}" Text="Start New Game" />
<Border Style="{StaticResource SectionBorder}">
<StackPanel Background="#80000000">
<TextBlock Style="{StaticResource HeaderText2}" Text="Player Options:" />
<Grid Height="auto" Width="auto" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="128" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
FontFamily="Arial Black"
FontSize="16pt"
FontWeight="Bold"
Foreground="White"
Grid.Column="0"
VerticalAlignment="Center"
Margin="15,0,0,0"
Text="Name:"
/>
<TextBox
FontSize="24pt"
Grid.Column="1"
VerticalAlignment="Center" Margin="0,0,6,0"
x:Name="PlayerNameTextBox"
/>
</Grid>
<CheckBox
Content="Spectator"
IsChecked="{Binding SpectatorEnabled}"
FlowDirection="RightToLeft"
FontSize="16"
FontWeight="Bold"
Foreground="White"
Margin="16">
<CheckBox.Resources>
<Style TargetType="{x:Type Path}">
<Setter Property="FlowDirection" Value="LeftToRight" />
</Style>
</CheckBox.Resources>
</CheckBox>
</StackPanel>
</Border>
<Border Style="{StaticResource SectionBorder}">
<StackPanel Background="#80000000">
<TextBlock Style="{StaticResource HeaderText2}" Text="Network Options:" />
<StackPanel
HorizontalAlignment="Center"
Margin="4"
Orientation="Horizontal">
<RadioButton
IsThreeState="False"
GroupName="ConnectionMode"
Content="Join"
FontSize="16pt"
Foreground="White"
IsChecked="{Binding IsJoinSelected}"
Margin="8"
x:Name="JoinRadioButton" />
<RadioButton
IsThreeState="False"
GroupName="ConnectionMode"
Content="Host"
FontSize="16pt"
Foreground="White"
Margin="8"
IsChecked="{Binding IsHostSelected}" />
</StackPanel>
<Grid Height="auto" Width="auto" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="128" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
FontFamily="Arial Black"
FontSize="16pt"
FontWeight="Bold"
Foreground="White"
Grid.Column="0"
VerticalAlignment="Center"
Margin="15,0,0,0"
Text="IP:" />
<TextBox
FontSize="24pt"
Grid.Column="1"
VerticalAlignment="Center" Margin="0,0,6,6"
x:Name="IPTextBox" />
</Grid>
<Grid Height="auto" Width="auto" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="128" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
FontFamily="Arial Black"
FontSize="16pt"
FontWeight="Bold"
Foreground="White"
Grid.Column="0"
VerticalAlignment="Center"
Margin="15,0,0,0"
Text="Port:" />
<TextBox
FontSize="24pt"
Grid.Column="1"
VerticalAlignment="Center" Margin="0,0,6,0"
x:Name="PortTextBox" />
</Grid>
<StackPanel
HorizontalAlignment="Center"
Margin="0,16,0,16"
Orientation="Horizontal">
<StackPanel.Resources />
<Button
Background="{StaticResource DarkRedGradient}"
Content="Cancel"
Command="{Binding CancelCommand}"
FontSize="24"
FontWeight="Bold"
Height="64"
Margin="16"
Template="{StaticResource CoolBtnTemplate}"
Width="128" />
<Button
Background="{StaticResource DarkBlueGradient}"
Command="{Binding StartCommand}"
Content="Start"
FontSize="24"
FontWeight="Bold"
Height="64"
Margin="16"
Template="{StaticResource CoolBtnTemplate}"
Width="128" />
</StackPanel>
</StackPanel>
</Border>
</StackPanel>
</Viewbox>
</UserControl>
StartMPGameControl.xaml.cs (2,787 bytes)
#if UNITY_5_3_OR_NEWER
#define NOESIS
using Noesis;
using UnityEngine;
#else
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
#endif
namespace Fury.UI.Windows
{
public partial class StartMPGameControl : UserControl
{
public StartMPGameControl()
{
this.Initialized += OnInitialized;
InitializeComponent();
}
#if NOESIS
void InitializeComponent() => NoesisUnity.LoadComponent(this);
#endif
public TextBox PlayerNameTextBox;
public TextBox IPTextBox;
public TextBox PortTextBox;
void OnInitialized(object sender, EventArgs args)
{
// this.DataContext is null
PlayerNameTextBox = (TextBox)FindName("PlayerNameTextBox");
IPTextBox = (TextBox)FindName("IPTextBox");
PortTextBox = (TextBox)FindName("PortTextBox");
if (PlayerNameTextBox != null)
{
PlayerNameTextBox.TextChanged += OnPlayerInputTextBoxChanged;
}
if (IPTextBox != null)
{
IPTextBox.TextChanged += OnIPTextBoxChanged;
}
if (PortTextBox != null)
{
PortTextBox.TextChanged += OnPortTextBoxChanged;
}
}
void OnPlayerInputTextBoxChanged(object sender, RoutedEventArgs e)
{
if (this.DataContext is StartMPGameViewModel viewModel)
{
//Debug.Log($"PlayerInput changed to: {kak}");
viewModel.PlayerName = PlayerNameTextBox.Text;
}
}
void OnIPTextBoxChanged(object sender, RoutedEventArgs e)
{
if (this.DataContext is StartMPGameViewModel viewModel)
{
//Debug.Log($"IP changed to: {tak}");
viewModel.IPString = IPTextBox.Text;
}
}
void OnPortTextBoxChanged(object sender, RoutedEventArgs e)
{
if (this.DataContext is StartMPGameViewModel viewModel)
{
//Debug.Log($"Port changed to: {pak}");
viewModel.PortString = PortTextBox.Text;
}
}
/*public string PlayerInput
{
get { return (string)GetValue(PlayerInputProperty); }
set { SetValue(PlayerInputProperty, value); }
}*/
/*public static readonly DependencyProperty PlayerInputProperty =
DependencyProperty.Register("PlayerInput", typeof(string), typeof(StartMPGameControl), new PropertyMetadata(string.Empty));
*/
/*public static void OnPlayerInputChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = d as StartMPGameControl;
if(control != null)
{
string newValue = e.NewValue as string;
Debug.Log($"PlayerInput changed to: {newValue}");
}
}*/
}
} |
|
|
Could you also create a minimal project reproducing this issue? |
|
|
Build for macOS, run Thank you |
|
|
Thank you |
|
|
Is there anything I can do to fix this xaml so that it won't crash on exit every time? |
|
|
Sorry I didn't have time to work on this yet. |
|
|
I am working on this now. I have just built a a standalone version of the game. When it launches I see the "Start New Game" screen, I click on the buttons and just close the app. No crashes. Do I need to do something more specific? |
|
|
Perhaps try it a couple times I removed all of the styling and it stopped crashing. |
|
|
Great, finally I am reproducing this. :) |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2023-11-22 15:58 | Kirkules | New Issue | |
| 2023-11-22 16:00 | Kirkules | Description Updated | |
| 2023-11-22 16:33 | Kirkules | Description Updated | |
| 2023-11-22 18:06 | jsantos | Assigned To | => jsantos |
| 2023-11-22 18:06 | jsantos | Status | new => assigned |
| 2023-11-22 18:07 | jsantos | Note Added: 0008972 | |
| 2023-11-22 18:07 | jsantos | Status | assigned => feedback |
| 2023-11-22 18:50 | Kirkules | Note Added: 0008973 | |
| 2023-11-22 18:50 | Kirkules | Status | feedback => assigned |
| 2023-11-22 19:00 | jsantos | Note Added: 0008974 | |
| 2023-11-22 19:00 | jsantos | Status | assigned => feedback |
| 2023-11-22 19:27 | Kirkules | Note Added: 0008975 | |
| 2023-11-22 19:27 | Kirkules | Status | feedback => assigned |
| 2023-11-22 19:36 | jsantos | Note Added: 0008976 | |
| 2023-11-22 19:47 | Kirkules | Note Added: 0008978 | |
| 2023-11-22 19:47 | Kirkules | File Added: StartMPGameViewModel.cs | |
| 2023-11-22 19:47 | Kirkules | File Added: StartMPGameControl.xaml | |
| 2023-11-22 19:47 | Kirkules | File Added: StartMPGameControl.xaml.cs | |
| 2023-11-22 20:20 | jsantos | Note Added: 0008979 | |
| 2023-11-22 20:20 | jsantos | Status | assigned => feedback |
| 2023-11-22 20:27 | Kirkules | Note Added: 0008980 | |
| 2023-11-22 20:27 | Kirkules | File Added: DOANoesisCinemachine3.zip | |
| 2023-11-22 20:27 | Kirkules | Status | feedback => assigned |
| 2023-11-22 20:31 | jsantos | Note Added: 0008981 | |
| 2023-11-22 20:31 | jsantos | Product Version | 3.2 => 3.2.2 |
| 2023-11-22 20:31 | jsantos | Target Version | => 3.2.3 |
| 2023-12-01 14:16 | Kirkules | Note Added: 0008992 | |
| 2023-12-01 16:55 | jsantos | Note Added: 0008994 | |
| 2024-01-22 11:47 | sfernandez | Target Version | 3.2.3 => 3.2.4 |
| 2024-01-22 11:54 | jsantos | Target Version | 3.2.4 => 3.2.3 |
| 2024-01-25 20:56 | jsantos | Note Added: 0009124 | |
| 2024-01-25 20:56 | jsantos | Note Edited: 0009124 | |
| 2024-01-25 20:56 | jsantos | Status | assigned => feedback |
| 2024-01-26 02:16 | Kirkules | Note Added: 0009127 | |
| 2024-01-26 02:16 | Kirkules | Status | feedback => assigned |
| 2024-01-26 21:06 | jsantos | Note Added: 0009133 | |
| 2024-01-28 17:18 | jsantos | Fixed in Version | => 3.2.3 |
| 2024-01-28 17:19 | jsantos | Status | assigned => resolved |
| 2024-01-28 17:19 | jsantos | Resolution | open => fixed |
| 2025-10-10 13:29 | jsantos | Category | Unity3D => Unity |