View Issue Details

IDProjectCategoryView StatusLast Update
0003289NoesisGUIUnity3Dpublic2024-06-07 19:23
Reporterkristoffer Assigned Tojsantos  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Product Version3.2.3 
Target Version3.2.4 
Summary0003289: Unity non-zero exit code after using NoesisRenderer with ExecuteCommandBuffer
DescriptionWindows 11, Unity 2022.3.25 and Noesis 3.2.3

This issue is based on the discussion in https://www.noesisengine.com/forums/viewtopic.php?p=16951

After using code almost identical to NoesisXamlEditor.RenderPreview(...) when Unity exits it will have a non-zero return code.
In my experience the return code is either -1073741819 or -1073740791.

When launching Unity from command line to run through a Play Mode test suite and then exit this presents a problem since it's desirable to look at the Unity exit code to evaluate the test run status.

Note that there is no error or warning logged in Unity and the result rendered is correct so in most cases this is not a problem.

As stated in the forum thread adding a call to
NoesisRenderer.UnregisterView(view, _commands);
before the call to
UnityEngine.Graphics.ExecuteCommandBuffer(_commands);
seems to resolve the issue.

But that solution may not be a good way to go about it.
TagsUnity
PlatformWindows

Activities

jsantos

jsantos

2024-06-07 19:23

manager   ~0009671

Last edited: 2024-06-07 19:23

After analyzing this a bit more, you change makes sense. The view needs to be unregistered, and this is done emitting commands that must be executed by ExecuteCommandBuffer.

Our editors (for example NoesisXamlEditor) is already doing this when disabled:

public void OnDisable()
{
    if (_viewPreview != null)
    {
        NoesisRenderer.UnregisterView(_viewPreview, _commands);
        Graphics.ExecuteCommandBuffer(_commands);
        _commands.Clear();
        _viewPreview.Content?.Dispose();
        _viewPreview.Dispose();
        _viewPreview = null;
    }

    if (_viewPreviewGUI != null)
    {
        NoesisRenderer.UnregisterView(_viewPreviewGUI, _commands);
        Graphics.ExecuteCommandBuffer(_commands);
        _commands.Clear();
        _viewPreviewGUI.Content?.Dispose();
        _viewPreviewGUI.Dispose();
        _viewPreviewGUI = null;
    }
}

So everything is good, closing this

Issue History

Date Modified Username Field Change
2024-05-02 10:20 kristoffer New Issue
2024-05-02 10:20 kristoffer Tag Attached: Unity
2024-05-02 11:49 sfernandez Assigned To => jsantos
2024-05-02 11:49 sfernandez Status new => assigned
2024-05-02 11:49 sfernandez Target Version => 3.2.4
2024-06-07 19:23 jsantos Note Added: 0009671
2024-06-07 19:23 jsantos Note Edited: 0009671
2024-06-07 19:23 jsantos Note Edited: 0009671
2024-06-07 19:23 jsantos Status assigned => resolved
2024-06-07 19:23 jsantos Resolution open => no change required