View Issue Details

IDProjectCategoryView StatusLast Update
0002079NoesisGUIUnrealpublic2021-09-13 14:15
Reporterdaniel.janak Assigned Tohcpizzi  
PrioritynormalSeveritycrashReproducibilitysometimes
Status resolvedResolutionfixed 
Product Version3.1.0 
Target Version3.1.1 
Summary0002079: Crashes with TextInputMethodSystem
DescriptionWe’ve had some crashes when we were typing into a TextBox and then closed UI with a button that’s not focusable. It crashed on Context ensure.
We’ve had to Deactivate context right before Unregistering context:

void UNoesisInstance::TermInstance()
{
    if (XamlView)
    {
        Noesis::Ptr<Noesis::IRenderer> Renderer(XamlView->GetRenderer());
        Xaml.Reset();
        XamlView.Reset();

        // Pass the slate element to the render thread so that it's deleted after it's shown for the last time
        ENQUEUE_RENDER_COMMAND(SafeDeleteNoesisSlateElement)
        (
            [Renderer, NoesisSlateElement = NoesisSlateElement](FRHICommandListImmediate& RHICmdList) mutable
            {
                Renderer->Shutdown();
                NoesisSlateElement.Reset();
            }
        );
    }

    ITextInputMethodSystem* const TextInputMethodSystem = FSlateApplication::IsInitialized() ? FSlateApplication::Get().GetTextInputMethodSystem() : nullptr;
    if (TextInputMethodSystem)
    {
        for (auto TextInputMethodContextPair : TextInputMethodContexts)
        {
            TextInputMethodSystem->DeactivateContext(TextInputMethodContextPair.Value.ToSharedRef());
            TextInputMethodSystem->UnregisterContext(TextInputMethodContextPair.Value.ToSharedRef());
        }
    }
}
TagsNo tags attached.
PlatformAny

Activities

hcpizzi

hcpizzi

2021-08-30 12:31

developer   ~0007391

Hi Daniel,

I tried this, and couldn't reproduce the issue. I used RemoveFromParent on the Unreal Widget, and then, when the garbage collector run, UNoesisInstance::TermInstance was called, and the destruction of the IView caused UNoesisInstance::OnPreviewLostKeyboardFocus to be called, and the context was correctly deactivated before it was unregistered at the end of UNoesisInstance::TermInstance.

I have a couple of questions: How are you removing the UI? Are you calling RemoveFromParent too? And, in UNoesisInstance::TermInstance, is the IView released (i.e. is there a single reference before calling XamlView.Reset()?

Thanks
hcpizzi

hcpizzi

2021-09-13 14:15

developer   ~0007440

I haven't been able to reproduce the issue, but I've gone on and added the call to DeactivateContext. I've wrapped it in an if IsActiveContext in case other platforms complain about deactivating twice.

Issue History

Date Modified Username Field Change
2021-08-10 11:21 sfernandez New Issue
2021-08-10 11:23 sfernandez Assigned To => hcpizzi
2021-08-10 11:23 sfernandez Status new => assigned
2021-08-10 11:23 sfernandez Target Version => 3.1.1
2021-08-10 11:23 sfernandez Description Updated
2021-08-26 10:27 sfernandez Reporter sfernandez => daniel.janak
2021-08-30 12:31 hcpizzi Note Added: 0007391
2021-09-08 16:55 jsantos Status assigned => feedback
2021-09-13 14:15 hcpizzi Status feedback => resolved
2021-09-13 14:15 hcpizzi Resolution open => fixed
2021-09-13 14:15 hcpizzi Note Added: 0007440